diff --git a/minerva_analysis/__init__.py b/minerva_analysis/__init__.py index 74440e590..fc681f5b4 100644 --- a/minerva_analysis/__init__.py +++ b/minerva_analysis/__init__.py @@ -14,25 +14,23 @@ # If you're running the pyinstaller version of the code, create a # new directory for the data (this will be at ~/ on mac) if getattr(sys, 'frozen', False): - data_path = Path(os.path.dirname(sys.executable) + '/data') + data_path = Path(os.path.dirname(sys.executable)) / 'data' multiprocessing.freeze_support() else: data_path = Path("minerva_analysis/data") - +# print('Data Path', str(data_path), str((data_path).resolve())) +# Make the Data Path +data_path.mkdir(parents=True, exist_ok=True) app = Flask(__name__, template_folder=Path('client/templates'), static_folder='data') app.config['TEMPLATES_AUTO_RELOAD'] = True -app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + str(data_path.resolve()) + '/db.sqlite3' +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + str(data_path) + '/db.sqlite3' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['CLIENT_PATH'] = app.root_path + '/client/' - config_json_path = data_path / "config.json" db = SQLAlchemy(app) def get_config(): - if not os.path.isdir(data_path): - os.makedirs(data_path) - if not os.path.isfile(config_json_path): with open(config_json_path, 'w') as f: json.dump({}, f) diff --git a/minerva_analysis_mac.spec b/minerva_analysis_mac.spec new file mode 100644 index 000000000..de5f66ee9 --- /dev/null +++ b/minerva_analysis_mac.spec @@ -0,0 +1,40 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis(['run.py'], + pathex=['/opt/homebrew/anaconda3/envs/viewer', '/Users/swarchol/Research/minerva_analysis'], + binaries=[], + datas=[('minerva_analysis/client', 'minerva_analysis/client'), ('minerva_analysis/__init__.py', 'minerva_analysis/'), ('minerva_analysis/server', 'minerva_analysis/server'), ('/opt/homebrew/anaconda3/envs/viewer/lib/python3.7/site-packages/xmlschema/schemas', 'xmlschema/schemas')], + hiddenimports=['scipy.spatial.transform._rotation_groups', 'sqlalchemy.sql.default_comparator', 'cmath'], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='minerva_analysis_mac', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None )