rewrite
Nate Smith 2023-12-09 15:58:40 -08:00
parent 673232919b
commit 67676dda8d
1 changed files with 2 additions and 6 deletions

View File

@ -60,7 +60,6 @@ def mkdb(p: str, sql: str) -> Optional[Exception]:
return Exception(f"failed to initialize {p}: {e}")
return None
def setup() -> Optional[Exception]:
bdir = path.expanduser(path.join("~", BOTANY_DIR))
e = mkdir(bdir)
@ -72,14 +71,11 @@ def setup() -> Optional[Exception]:
if e is not None:
return e
plotdb_path = path.join(bdir, "db/plot.db")
# TODO test manually to see what kind of permissions fuckery we need
e = mkdb(plotdb_path, PLOT_SCHEMA)
e = mkdb(path.join(bdir, "db/plot.db"), PLOT_SCHEMA)
if e is not None:
return e
visitordb_path = path.join(bdir, "db/visitors.db")
e = mkdb(visitordb_path, VISITORS_SCHEMA)
e = mkdb(path.join(bdir, "db/visitors.db"), VISITORS_SCHEMA)
if e is not None:
return e