def get_root_id(): # Check to see which root id we are getting key = KEY_CLOUD_ROOT_ID title = "Cloud ID Missing" if Dev.get("ALT_LOCATION"): key = KEY_CLOUD_ROOT_ID_DEV title = "Cloud DEVELOPMENT ID Missing" # Get the ID from Settings result = Settings.get_key(key) # If the ID doesnt exist in settings, lets ask for it! if not result: dialog = Dialog( title = title, body = [ f'The Cloud root ID is currently missing.. So lets find it!', f'\n', f'\n', f'Ask your administrator for the "Cloud Root Filepath" and', f'enter that path below.', f'\n', f'\n', ] ) ans = dialog.get_result("Filepath") result = Drive.get_id(search=ans, root="root") if not result: raise Exception("There was a problem with getting the Cloud Root ID..") Settings.set_key(key, result) return result
def _get_endpoint_key(self, endpoint): if endpoint == "dev": return Settings.get_key(Settings.slack_dev_key) elif endpoint == "prod": return Settings.get_key(Settings.slack_prod_key)
f'Note:', f'\n', f' This update requires a full restart of LOFSongManager. When', f'this update has completed, the software should shut down on its', f'own. If it does not, please restart the software.', f'\n', f'\n', f' Please ignore the next warning, "src.env.VERSION does not match"..', f'This is expected and gets fixed by this update.', f'\n', f'\n', f'For more information, please refer to the repository commits.', f'\n', f'\n', ]) dialog.press_enter() File.delete("development.py") File.delete("compressed_songs/db.json") # Change 'user' key to 'username' in settings Settings.set_key("username", Settings.get_key("user")) # just to make sure we have the right ones Settings.reset_slack_endpoints() # 0 = there was a problem upgrading # 1 = do not restart core # 2 = restart core is necessary sys.exit(2)
# this is required to access 'src' modules import os, sys currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir = os.path.dirname(currentdir) sys.path.append(parentdir) ########################################## from src.Settings import Settings from src.TERMGUI.Log import Log from src.TERMGUI.Dialog import Dialog from src.FileManagement.File import File if __name__ == "__main__": # Before we finish the update, we need to update the core files if not Settings.get_key("update_git"): Settings.set_key("update_git", True) dialog = Dialog( title="Upgrading to V1.3!", body=[ f'Welcome to a new friendly update! Hopefully everything goes nice', f'and smooth, haha! .... #justkiddingbutseriously', f'\n', f'\n', f'The main fix for this update solves the slow-down issues while trying', f'to open up a project.', f'\n', f'\n', f'There also was some significant code improvements on both local and remote', f'servers to allow for new features, yay! Features such',