def setup(): # Setting up Config object default_config = DefaultConfig() # Initilizing Main object and configuring # in one step pyi = PyiUpdater(default_config) # Can also update config later pyi.update_config(default_config) # Initializing Package Handler & Key Handler # with config info package_handler = PackageHandler(pyi) key_handler = KeyHandler(pyi) # Can also be Initilized without config package_handler = PackageHandler() key_handler = KeyHandler() # Then update handlers with config later package_handler.init_app(pyi) key_handler.init_app(pyi) # Setting up work directories # Only need to run once on a new project but it's # ok if ran multipule times package_handler.setup() # Now place new packages in the folder named # "new" in the pyi-data directory # Package Archive filename should be in the form # AppName-platform-version.zip raw_input('Place updates in new folder then press enter.') # This updates the version file with the # new packages & moves them to the deploy folder. package_handler.process_packages() # This signs the update manifest & copies it # to the deploy folder key_handler.sign_update()
def test_execution(): global test_data_dir config = TConfig() updater = PyiUpdater(config) ph = PackageHandler(updater) kh = KeyHandler(updater) ph.setup() kh.test = True kh.make_keys() # Make zipfile with ChDir(test_data_dir): os.mkdir(u'test-app') with ChDir(u'test-app'): with open(u'app.txt', u'w') as f: f.write(u'I am so happy' * 1000) shutil.make_archive(u'Test App-mac-0.2.0', u'zip', u'test-app') shutil.move(u'Test App-mac-0.2.0.zip', u'new') ph.process_packages() kh.sign_update()