# HG changeset patch # User Tuomo Valkonen # Date 1516497246 0 # Node ID c3e95212e3f0451afbc227b3a606ee070c6f7af0 # Parent c36e549a7f12dfccc883c5e1da3f3ac83bcc555a py2app standalone app generation diff -r c36e549a7f12 -r c3e95212e3f0 README.md --- a/README.md Sun Jan 21 00:58:06 2018 +0000 +++ b/README.md Sun Jan 21 01:14:06 2018 +0000 @@ -11,6 +11,16 @@ - [rumps](https://github.com/jaredks/rumps) (Ridiculously Uncomplicated macOS Python Statusbar apps) - [keyring](https://pypi.python.org/pypi/keyring) +To create a standalone app, you can + + pip install py2app + +(for alternatives see [py2app documentation](https://py2app.readthedocs.io/en/latest/install.html#installing-with-pip)), and then + + python3 setup.py py2app + +This will place the app under `dist/`. + ## Usage ### Passphrases diff -r c36e549a7f12 -r c3e95212e3f0 config.py --- a/config.py Sun Jan 21 00:58:06 2018 +0000 +++ b/config.py Sun Jan 21 01:14:06 2018 +0000 @@ -119,7 +119,7 @@ logging.info("Reading configuration file %s" % cfgfile) if not (os.path.exists(cfgfile) and os.path.isfile(cfgfile)): - raise SystemExit(f'Configuration file required: {cfgfile}') + raise SystemExit('Configuration file required: {cfgfile}') with io.open(cfgfile, 'r') as file: settings=expand_env(yaml.load(file), os.environ); diff -r c36e549a7f12 -r c3e95212e3f0 setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup.py Sun Jan 21 01:14:06 2018 +0000 @@ -0,0 +1,18 @@ +from setuptools import setup + +APP = ['borgend.py'] +DATA_FILES = [] +OPTIONS = { + 'argv_emulation': True, + 'plist': { + 'LSUIElement': True, + }, + 'packages': ['rumps', 'keyring'], +} + +setup( + app=APP, + data_files=DATA_FILES, + options={'py2app': OPTIONS}, + setup_requires=['py2app'], +)