Skip to content

Commit

Permalink
added appdirs code block (commented out) for use on O2
Browse files Browse the repository at this point in the history
  • Loading branch information
nchuynh committed Jan 23, 2023
1 parent 8859ffb commit 5c79ee1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions minerva_analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from flask import Flask
from pathlib import Path
from flask_sqlalchemy import SQLAlchemy
from appdirs import user_data_dir

from numcodecs import compat_ext # Needed for pyinstaller
from numcodecs import blosc # Needed for pyinstaller
Expand All @@ -17,11 +18,20 @@
#centralizing path across app
cwd_path = Path.cwd()

## uncomment block if not on O2
if getattr(sys, 'frozen', False):
data_path = Path(Path(sys.executable).parent / 'data')
multiprocessing.freeze_support()
else:
data_path = Path("minerva_analysis/data").resolve()

## uncomment block if on O2
# appname = "minerva_analysis"
# appauthor = "lsp"
# data_path = Path(user_data_dir(appname, appauthor)+'/data').resolve()
# if getattr(sys, 'frozen', False):
# multiprocessing.freeze_support()

# print('Data Path', str(data_path), str((data_path).resolve()))
# Make the Data Path
data_path.mkdir(parents=True, exist_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- jinja2==3.0.3
- werkzeug==2.0.3
- itsdangerous==2.0.1
- appdirs
- flask-sqlalchemy
- numpy
- ome-types
Expand All @@ -26,4 +27,3 @@ dependencies:
- opencv-python==4.5.3.56



0 comments on commit 5c79ee1

Please sign in to comment.