Skip to content

Commit 5c79ee1

Browse files
committed
added appdirs code block (commented out) for use on O2
1 parent 8859ffb commit 5c79ee1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

minerva_analysis/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from flask import Flask
22
from pathlib import Path
33
from flask_sqlalchemy import SQLAlchemy
4+
from appdirs import user_data_dir
45

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

21+
## uncomment block if not on O2
2022
if getattr(sys, 'frozen', False):
2123
data_path = Path(Path(sys.executable).parent / 'data')
2224
multiprocessing.freeze_support()
2325
else:
2426
data_path = Path("minerva_analysis/data").resolve()
27+
28+
## uncomment block if on O2
29+
# appname = "minerva_analysis"
30+
# appauthor = "lsp"
31+
# data_path = Path(user_data_dir(appname, appauthor)+'/data').resolve()
32+
# if getattr(sys, 'frozen', False):
33+
# multiprocessing.freeze_support()
34+
2535
# print('Data Path', str(data_path), str((data_path).resolve()))
2636
# Make the Data Path
2737
data_path.mkdir(parents=True, exist_ok=True)

requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dependencies:
77
- jinja2==3.0.3
88
- werkzeug==2.0.3
99
- itsdangerous==2.0.1
10+
- appdirs
1011
- flask-sqlalchemy
1112
- numpy
1213
- ome-types
@@ -26,4 +27,3 @@ dependencies:
2627
- opencv-python==4.5.3.56
2728

2829

29-

0 commit comments

Comments
 (0)