示例#1
0
def runODM():
    app = wx.App(False)
    #frame = create(None)
    #frame.Show()
    app.MainLoop()


if __name__ == '__main__':
    logger.debug("Welcome to ODMTools Python. Please wait as system loads")
    # https://docs.python.org/2/library/multiprocessing.html#miscellaneous

    # Add support for when a program which uses multiprocessing has been frozen to produce a Windows executable.
    # (Has been tested with py2exe, PyInstaller and cx_Freeze.)
    # One needs to call this function straight after the if __name__ == '__main__' line of the main module.

    # If the freeze_support() line is omitted then trying to run the frozen executable will raise RuntimeError.
    # If the module is being run normally by the Python interpreter then freeze_support() has no effect.
    freeze_support()

    # Determine the number of CPU's available
    numproc = cpu_count()

    # Initialize TaskServer.
    # This class starts the processes before starting wxpython and is needed
    tsmp = TaskServerMP(numproc=numproc)
    memdb = MemoryDatabase()

    # Build app with taskserver included
    app = MyApp(False, taskserver=tsmp, memdb=memdb)
    app.MainLoop()
示例#2
0
 def setup(self):
     self.numprocess = cpu_count()
     self.taskserver = TaskServerMP(numproc=self.numprocess)