From fd791fe181a1f0e3a69b48a5a8295e0132b072ea Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 27 Jul 2020 09:39:54 -0500 Subject: [PATCH] Modified update paths and files in order to deploy the next date based release --- src/application.py | 9 +++------ src/update/updater.py | 8 ++------ src/write_version_data.py | 13 ++++++++++++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/application.py b/src/application.py index d5cdb23..9cc49ea 100644 --- a/src/application.py +++ b/src/application.py @@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- -import sys -python_version = int(sys.version[0]) name = "MusicDL" -version = "0.7" author = "Manuel Cortéz" authorEmail = "manuel@manuelcortez.net" copyright = "Copyright (C) 2019-2020, Manuel Cortez" @@ -14,6 +11,6 @@ translators = [_(u"Manuel Cortez (Spanish)")] bts_name = "music_dl" bts_access_token = "fe3j2ijirvevv9" bts_url = "https://issues.manuelcortez.net" -update_stable_url = "https://manuelcortez.net/static/files/music_dl/update/stable.json" -update_next_url = "https://manuelcortez.net/static/files/music_dl/update/alpha.json" -update_next_version=None \ No newline at end of file +update_url = "https://manuelcortez.net/static/files/music_dl/update/latest.json" +version = "2020.07.23" +update_next_version = "14775226" \ No newline at end of file diff --git a/src/update/updater.py b/src/update/updater.py index 91e0b1b..6800287 100644 --- a/src/update/updater.py +++ b/src/update/updater.py @@ -12,12 +12,8 @@ def do_update(update_type="alpha"): # Updates cannot be performed in the source code version. if hasattr(sys, "frozen") == False: return - if update_type == "stable": - endpoint = application.update_stable_url - version = application.version - else: - endpoint = application.update_next_url - version = application.update_next_version + endpoint = application.update_url + version = application.update_next_version try: return update.perform_update(endpoint=endpoint, current_version=version, app_name=application.name, update_type=update_type, update_available_callback=available_update_dialog, progress_callback=progress_callback, update_complete_callback=update_finished) except ConnectionError: diff --git a/src/write_version_data.py b/src/write_version_data.py index ff0742e..e320b77 100644 --- a/src/write_version_data.py +++ b/src/write_version_data.py @@ -11,9 +11,20 @@ commit = commit_info["short_id"] print("Got new version info: {commit}".format(commit=commit,)) file = open("application.py", "r", encoding="utf-8") lines = file.readlines() +lines[-2] = 'version = "{}"\n'.format(commit_info["created_at"][:10].replace("-", ".")) lines[-1] = 'update_next_version = "{commit}"'.format(commit=commit,) file.close() file2 = open("application.py", "w", encoding="utf-8") file2.writelines(lines) file2.close() -print("Wrote application.py with the new version info.") \ No newline at end of file +print("Wrote application.py with the new version info.") + +print("Updating next version on installer setup...") +file = open("installer.nsi", "r", encoding="utf-8") +contents = file.read() +contents = contents.replace("0.7", commit_info["created_at"][:10].replace("-", ".")) +file.close() +file2 = open("installer.nsi", "w", encoding="utf-8") +file2.write(contents) +file2.close() +print("done") \ No newline at end of file