def main(): from database import DB from face import PWindow from shutil import copy import gtk import os dbo = DB() pw = PWindow(dbo) pw.connect('valid_password_entered', run_db_window, dbo) pw.pw.connect('delete-event', lambda x,y: gtk.main_quit()) gtk.main()
print >> fd, datetime.now() fd.close() dbo = DB() # if (dbo.mdate - dbo.cdate) > timedelta(7): # error_dialog(None, 'Заплатите разработчикам! Они тоже хотят кушать!') # dbo.db.close() # try: # os.remove('flatdb'+os.sep+'.lock') # except IOError, err: # print >> sys.stderr, \ # "ERROR: can't remove file: %s: %s", \ # 'flatdb'+os.sep+'.lock', err[1] # gtk.main_quit() # return pw = PWindow(dbo) pw.connect("valid_password_entered", run_db_window, dbo) pw.pw.connect("delete-event", lambda x, y: pass_quit()) def pass_quit(): dbo.db.close() try: os.remove("flatdb" + os.sep + ".lock") except IOError, err: print >> sys.stderr, "ERROR: can't remove file: %s: %s", "flatdb" + os.sep + ".lock", err[1] gtk.main_quit() gtk.main() def run_db_window(PWindow, dbo):