Skip to content

Commit

Permalink
Updating directory
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwarchol committed Aug 16, 2021
1 parent 18948b6 commit aa380cc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
12 changes: 5 additions & 7 deletions minerva_analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
40 changes: 40 additions & 0 deletions minerva_analysis_mac.spec
Original file line number Diff line number Diff line change
@@ -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 )

0 comments on commit aa380cc

Please sign in to comment.