예제 #1
0
파일: script.py 프로젝트: Schevo/schevogtk
 def main(self, arg0, args):
     print
     print
     if GTK_AVAILABLE:
         parser = _parser()
         options, args = parser.parse_args(list(args))
         if args:
             url = args[0]
         else:
             url = None
         # Create PyGTK application.
         app = Application()
         # Open the database.
         if url:
             print 'Opening database', url
             app.database_open(url)
         # Start PyCrust if requested.
         if options.pycrust:
             start_pycrust(app=app)
             print 'PyCrust started.'
         # Start PyGtk event loop.
         print 'Starting Navigator UI...'
         app.run()
     else:
         print 'GTK is not available.'
         return 1
예제 #2
0
 def main(self, arg0, args):
     print
     print
     if GTK_AVAILABLE:
         parser = _parser()
         options, args = parser.parse_args(list(args))
         if args:
             db_filename = args.pop(0)
             if not os.path.isfile(db_filename):
                 print "File %r must already exist" % db_filename
                 return 1
         else:
             db_filename = None
         # Create PyGTK application.
         app = Application()
         # Open the database.
         if db_filename:
             print "Opened database", db_filename
             app.database_open(db_filename)
         # Start PyCrust if requested.
         if options.pycrust:
             start_pycrust(app=app)
             print "PyCrust started."
         # Start PyGtk event loop.
         print "Starting Navigator UI..."
         app.run()
     else:
         print "GTK is not available."
         return 1