Moises Henriquez avatar Moises Henriquez committed 6970cb7

Added database sanity check and began working on preferences dialog

Comments (0)

Files changed (4)

         package_dir={'vpackager': 'src/vpackager'},
         package_data={'vpackager': ['data/*']},
         requires =['psutil'],
-        install_requires=['psutil',
-            'sqlite3'
-            ],
+        install_requires=['psutil'],
         scripts=['src/scripts/vpackager'],
         zip_safe=False)
-
-

src/vpackager/bot.py

     def __init__(self, dbase_model):
         gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
         self.dbase_model = dbase_model
+        self.CheckDatabase()
         self.body = gtk.VBox()
         datadir = os.path.dirname(os.path.abspath(__file__))
         datadir = os.path.join(datadir, 'data')
         self.dbase_model.RefreshQueue()
         self.dbase_model.RefreshHistory()
 
+    def CheckDatabase(self):
+        """ Run a sanity check and make sure the databse tables exist"""
+        if self.dbase_model.verify_tables() is True:
+            return self.dbase_model.CreateTables()
+
     def _get_menubar(self):
         mb = gtk.MenuBar()
         filemenu = gtk.Menu()

src/vpackager/dbutils.py

         except:
             return True
 
-
     def DeleteJob(self, job_id):
         """ Removes job_id from the job queue"""
         db, cursor = self._open()

src/vpackager/guitools.py

 __author_email__ = 'moc.liamg@xnl.E0M'[::-1]
 __version__ = '0.1'
 
+class PrefsDialog(gtk.Dialog):
+    """vpackager preferences dialog."""
+    def __init__(self, parent=None):
+        gtk.Dialog.__init__(self, parent=parent)
+        self.body = self.get_content_area()
+        self.set_has_separator(True)
+        self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
+        self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CANCEL)
+        
+
 class LogDisplay(gtk.Dialog):
     """ Dialog used to display the build log"""
     def __init__(self, logpath, parent, title='Build Log'):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.