Skip to content

Commit

Permalink
beta4
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dm4rtig4n committed Jul 13, 2023
1 parent a44fcae commit 742cdb1
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0-beta3
0.9.0-beta4
2 changes: 2 additions & 0 deletions app/models/ajax.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ def delete_all_data(self):
usage_point_id=self.usage_point_id,
measure_type="production"
).delete()
title(f"[{self.usage_point_id}] Suppression des statistiques.")
Stat(usage_point_id=self.usage_point_id).delete()
return {
"error": "false",
"notif": "Toutes les données ont été supprimées.",
Expand Down
6 changes: 6 additions & 0 deletions app/models/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,3 +1807,9 @@ def set_stat(self, usage_point_id, key, value):
)
self.session.flush()
return True

def del_stat(self, usage_point_id):
self.session.execute(
delete(Statistique)
.where(Statistique.usage_point_id == usage_point_id)
)
3 changes: 3 additions & 0 deletions app/models/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,6 @@ def generate_price(self):

self.db.set_stat(self.usage_point_id, f"price_{self.measurement_direction}", json.dumps(result))
return json.dumps(result)

def delete(self):
self.db.del_stat(self.usage_point_id)
13 changes: 11 additions & 2 deletions app/templates/html/usage_point_id.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@
</style>
<script>
$(document).ready(function () {
var finish = true

function retry() {
setTimeout(function () {
ajaxCall()
}, 5000);
}

function ajaxCall() {
function reload() {
if(finish == false) {
location.reload();
finish = true
}
}

function ajaxCall() {
$.ajax({
url: "/import_status",
type: 'GET',
Expand All @@ -26,10 +34,11 @@
const html = jqXHR.responseText
if (html === "true") {
$.LoadingOverlay("show", loading_import);
finish = false
retry()
} else {
$.LoadingOverlay("hide", loading_import);
retry()
reload()
}
},
error: function (xhr, textStatus) {
Expand Down
14 changes: 11 additions & 3 deletions dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def create_release(prerelease=False):
# GENERATE NEW RELEASE VERSION
new_release = last_version.split("-")[0]
new_version = []
new_version.append(Choice("new_beta", f"NEW BETA {new_release}"))
for idx, digit in enumerate(new_release.split(".")):
if idx > 0:
idx = int(idx) * 2
Expand All @@ -138,10 +139,15 @@ def create_release(prerelease=False):

branch = version


if version not in tags:
prerelease = inquirer.confirm(
message="It's prerelease (beta version) ?",
).execute()
if version == "new_beta":
prerelease = True
version = new_release
else:
prerelease = inquirer.confirm(
message="It's prerelease (beta version) ?",
).execute()
if prerelease:
beta_version = f"{version}-beta"
found_version = []
Expand All @@ -164,6 +170,8 @@ def create_release(prerelease=False):

switch_version(version)

print(version)

commit = cmd("git status --porcelain").stdout.decode()
if commit != "":
app.LOG.warning("Your code it's not commit!!")
Expand Down

0 comments on commit 742cdb1

Please sign in to comment.