def __init__(self):
        super(WxWindowMonitor, self).__init__()

        # Logging config on base-module level.
        logger = logging.getLogger(__name__)
        logging.config.fileConfig(r'logging_to_terminal.ini', disable_existing_loggers=False)
        # logging.config.fileConfig(r'logging_to_file.ini', disable_existing_loggers=False)
        # logging.config.fileConfig(r'logging_to_terminal_and_file.ini', disable_existing_loggers=False)

        # For sqlite: Check if database file exists, otherwise create.
        if database.database_config['type'] == 'sqlite':
            if not os.path.isfile(database.database_config['filename']):
                logger.info('Creating new sqlite database file ...')
                database.create_all_tables()
        elif database.database_config['type'] == 'postgresql':
            pass
        else:
            logger.error('Unsupported database type: "%s".' % database.database_config['type'])
            return

        # Show GUI.
        logger.debug('Loading GUI ...')
        self.frame = mainframe.MainFrame(None)
        self.SetTopWindow(self.frame)
        self.frame.Show()
Exemple #2
0
    def __init__(self):
        """Class constructor."""

        self.root = tk.Tk()
        self.mainframe = mainframe.MainFrame(self.root)

        self.mainframe.pack()
Exemple #3
0
 def OnInit(self):
     #load config        
     
     frame = mainframe.MainFrame(None, -1, "Photo Ya Crop - " + imageFileName, imageFileName)
     frame.Center()
     frame.Maximize()
     frame.Show(True)
     self.SetTopWindow(frame)
     return True
Exemple #4
0
def main():
    app = wx.App()

    dbase.CheckDB()
    dlg = mainframe.MainFrame(None, title=text.MainTitle)

    dlg.CenterOnScreen()
    dlg.ShowModal()
    dlg.Destroy()

    app.MainLoop()
Exemple #5
0
    def __init__(self):
        super(WxThreadingTemplate, self).__init__()

        # Logging config on base-module level.
        logger = logging.getLogger(__name__)
        logging.config.fileConfig(r'logging_to_terminal.ini',
                                  disable_existing_loggers=False)
        # logging.config.fileConfig(r'logging_to_file.ini', disable_existing_loggers=False)
        # logging.config.fileConfig(r'logging_to_terminal_and_file.ini', disable_existing_loggers=False)

        # Show GUI.
        logger.debug('Loading GUI ...')
        self.frame = mainframe.MainFrame(None)
        self.SetTopWindow(self.frame)
        self.frame.Show()
Exemple #6
0
 def OnInit(self):
     instanceId = '%s - %s' % (self.GetAppName(), wx.GetUserId())
     self.INSTANCECHECKER = wx.SingleInstanceChecker(instanceId)
     if self.IsOnlyInstance():
         self.CONFIG = wx.FileConfig(appName=i.APP_NAME,
                                     vendorName=i.APP_VENDOR,
                                     localFilename=os.path.join(
                                         os.path.abspath(os.path.curdir),
                                         i.APP_CONFIG_FILENAME),
                                     style=wx.CONFIG_USE_LOCAL_FILE)
         self.initXRCLocale(
             self.CONFIG.Read(i.APP_CONFIG_LOCALE_KEY,
                              i.APP_DEFAULT_LOCALE))
         self.MAINFRAME = mainframe.MainFrame()
         self.MAINFRAME.Show(True)
     else:
         wx.Exit()
     return True
Exemple #7
0
if __name__ == '__main__':
    import wx
    import mainframe

    app = wx.App()
    frame = mainframe.MainFrame()
    frame.Show()
    app.MainLoop()
Exemple #8
0
def main():
    templatesdb.createdb()
    settings.create_settings_file()
    app = wx.App()
    mainframe.MainFrame(None).Show()
    app.MainLoop()
Exemple #9
0
def main():
    app = QtGui.QApplication(sys.argv)
    frame = mainframe.MainFrame()
    frame.show()
    frame.raise_()  # Raise the window to the top (Only required on Mac OS X?)
    sys.exit(app.exec_())