Skip to content

Commit

Permalink
work on project manager database
Browse files Browse the repository at this point in the history
  • Loading branch information
rohankishore committed Aug 6, 2024
1 parent ef87f1a commit 034ad26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions auratext/Components/ProjectManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ def __init__(self, parent=None):

self.main_layout.addWidget(self.scroll_area)

self.load_todos()

days_rem_till_bday = 5


self.addCard_V(QIcon(f"{self.localappdata}/icons/explorer_filled.png"),
f"{days_rem_till_bday}", "days remaining till birthday")

Expand All @@ -106,3 +109,9 @@ def addCard_V(self, icon=None, title=None, content=None):

def remove_project_from_recent(self):
pass

def load_todos(self):
self.cursor.execute('SELECT id, time, description, status FROM todos WHERE date = ?', (self.date,))
todos = self.cursor.fetchall()
for name, path in todos:
self.addCard_V(QIcon(f"{self.localappdata}/icons/explorer_filled.png"), name, path)
6 changes: 3 additions & 3 deletions auratext/Core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def __init__(self):
# self._terminal_history = ""

# project manager db init
self.conn = sqlite3.connect(f"{self.localappdata}/data/ProjectManager.db")
self.conn = sqlite3.connect(f"{self.local_app_data}/data/ProjectManager.db")
self.dbcursor = self.conn.cursor()

self.dbcursor.execute('''
CREATE TABLE IF NOT EXISTS projects (
CREATE TABLE IF NOT EXISTS projects(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
path TEXT,
path TEXT
)
''')

Expand Down

0 comments on commit 034ad26

Please sign in to comment.