browser window started
authorJohn Ladan <jladan@uwaterloo.ca>
Mon, 19 Mar 2012 23:07:44 +0000 (19:07 -0400)
committerJohn Ladan <jladan@uwaterloo.ca>
Mon, 19 Mar 2012 23:07:44 +0000 (19:07 -0400)
browser.py [new file with mode: 0644]
dbLayer.py

diff --git a/browser.py b/browser.py
new file mode 100644 (file)
index 0000000..11fa0f6
--- /dev/null
@@ -0,0 +1,26 @@
+import curses
+import dbLayer as db
+
+class browserWindow:
+    highlight = 0
+    books = []
+
+    def refreshBooks(self):
+        self.books = db.getBooks()
+
+    def sortByColumn(self, col):
+        self.books.sort(key=get(col))
+
+    def refresh(self):
+        (my,mx) = w.getmaxyx()
+        self.displayHeader()
+        for r in range(2,my):
+            self.displayRow(my)
+
+    def displayRow(self,row):
+        self.w.addstr(row,1,"Row to be updated")
+
+
+
+
+
index 4b0f7ef..bc633a3 100644 (file)
@@ -1,5 +1,4 @@
 import sqlite3
-from json import dumps
 
 dbFile = 'sqLibrary.db'
 bookTable = 'books'
@@ -127,5 +126,3 @@ def createTriggers():
 
 createBooksTable()
 createTriggers()
-books = getBooks()
-print dumps(books,indent=2)