We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc6a68a commit 1eec9ddCopy full SHA for 1eec9dd
apc/db.py
@@ -4,11 +4,13 @@
4
from sqlalchemy.orm import sessionmaker, declarative_base
5
6
7
-db_path = pathlib.Path(__file__).parent.joinpath("..").resolve()
+apc_dir = pathlib.Path.home().joinpath(".apc-power-usage").resolve()
8
+if not apc_dir.exists():
9
+ apc_dir.mkdir()
10
11
12
engine = create_engine(
- "sqlite:///{}/main.db".format(db_path), connect_args={"check_same_thread": False}
13
+ "sqlite:///{}/main.db".format(apc_dir), connect_args={"check_same_thread": False}
14
)
15
Session = sessionmaker(bind=engine)
16
Base = declarative_base()
0 commit comments