fix environment path problem
Browse files
app.py
CHANGED
@@ -26,9 +26,8 @@ def anki_optimizer(file: gr.File, timezone, next_day_starts_at, revlog_start_dat
|
|
26 |
suffix = file.name.split('/')[-1].replace(".", "_").replace("@", "_")
|
27 |
proj_dir = Path(f'projects/{prefix}/{suffix}')
|
28 |
proj_dir.mkdir(parents=True, exist_ok=True)
|
29 |
-
print(proj_dir)
|
30 |
os.chdir(proj_dir)
|
31 |
-
|
32 |
optimizer = Optimizer()
|
33 |
optimizer.anki_extract(file.name)
|
34 |
analysis_markdown = optimizer.create_time_series(timezone, revlog_start_date, next_day_starts_at).replace("\n", "\n\n")
|
@@ -59,8 +58,11 @@ def anki_optimizer(file: gr.File, timezone, next_day_starts_at, revlog_start_dat
|
|
59 |
# Ratings
|
60 |
{rating_markdown}
|
61 |
"""
|
62 |
-
|
|
|
63 |
cleanup(proj_dir, files)
|
|
|
|
|
64 |
return w_markdown, markdown_out, plot_output, files_out
|
65 |
|
66 |
|
|
|
26 |
suffix = file.name.split('/')[-1].replace(".", "_").replace("@", "_")
|
27 |
proj_dir = Path(f'projects/{prefix}/{suffix}')
|
28 |
proj_dir.mkdir(parents=True, exist_ok=True)
|
|
|
29 |
os.chdir(proj_dir)
|
30 |
+
print(os.getcwd())
|
31 |
optimizer = Optimizer()
|
32 |
optimizer.anki_extract(file.name)
|
33 |
analysis_markdown = optimizer.create_time_series(timezone, revlog_start_date, next_day_starts_at).replace("\n", "\n\n")
|
|
|
58 |
# Ratings
|
59 |
{rating_markdown}
|
60 |
"""
|
61 |
+
os.chdir('../../..')
|
62 |
+
files_out = [proj_dir / file for file in files if (proj_dir / file).exists()]
|
63 |
cleanup(proj_dir, files)
|
64 |
+
print(os.getcwd())
|
65 |
+
print(files_out)
|
66 |
return w_markdown, markdown_out, plot_output, files_out
|
67 |
|
68 |
|