move variables to environment.

This commit is contained in:
fiatjaf
2019-12-13 19:41:39 -03:00
parent e5dc309eb1
commit 978854fc72
4 changed files with 21 additions and 12 deletions
+2 -5
View File
@@ -1,13 +1,10 @@
import os
import sqlite3
LNBITS_PATH = os.path.dirname(os.path.realpath(__file__))
DEFAULT_PATH = os.path.join(LNBITS_PATH, "data", "database.sqlite3")
from .settings import DATABASE_PATH
class Database:
def __init__(self, db_path: str = DEFAULT_PATH):
def __init__(self, db_path: str = DATABASE_PATH):
self.path = db_path
self.connection = sqlite3.connect(db_path)
self.cursor = self.connection.cursor()