def __init__(self): # log start initTs = time.clock() self.startupTimeStamp = time.time() # parse startup arguments start = startup.Startup() args = start.args # restore the persistent options dictionary self.d = {} self.options = options.Options(self) # options value watching self.maxWatchId = 0 self.watches = {} initialSize = (854,480) # get the platform module self.platform = None if args.p: if args.p == "maemo5": import maemo5 self.platform = maemo5.Maemo5(self, GTK=False) elif args.p == "harmattan": import harmattan self.platform = harmattan.Harmattan(self) else: import pc self.platform = pc.PC(self) else: # no platform provided, fallback to PC module import pc self.platform = pc.PC(self) # create the GUI startTs1 = timer.start() # RePho currently has only a single GUI module self.gui = gui.getGui(self, 'QML', accel=True, size=initialSize) timer.elapsed(startTs1, "GUI module import") # check if a path was specified in the startup arguments if args.o != None: try: print("loading manga from: %s" % args.o) self.setActiveManga(self.openManga(args.o)) print('manga loaded') except Exception, e: print("loading manga from path: %s failed" % args.o) print(e)
def __init__(self): # log start initTs = time.clock() self.startupTimeStamp = time.time() # parse startup arguments start = startup.Startup() args = start.args self.args = args # restore the persistent options dictionary self.d = {} self.options = options.Options(self) # options value watching self.maxWatchId = 0 self.watches = {} initialSize = (854, 480) # get the platform module self.platform = None # get the platform ID string platformId = "harmattan" # safe fallback if args.p is None: import platform_detection # platform detection result = platform_detection.getBestPlatformModuleId() if result: platformId = result else: # use the CLI provided value platformId = args.p if platformId == "harmattan": import harmattan self.platform = harmattan.Harmattan(self) else: print("can't start: current platform unknown") sys.exit(1) # create the GUI startTs1 = timer.start() # Panora currently has only a single QML based GUI module self.gui = gui.getGui(self, 'QML', accel=True, size=initialSize) timer.elapsed(startTs1, "GUI module import") timer.elapsed(initTs, "Init") timer.elapsed(startTs, "Complete startup") # start the main loop self.gui.startMainLoop()
def __init__(self): # log start initTs = time.clock() self.startupTimeStamp = time.time() # parse startup arguments start = startup.Startup() args = start.args self.args = args # restore the persistent options dictionary self.d = {} self.options = options.Options(self) # options value watching self.maxWatchId = 0 self.watches = {} # history lock self.historyLock = RLock() # enable stats self.stats = stats.Stats(self) self.continuousReading = True initialSize = (800,480) # get the platform module self.platform = None if args.p: if args.p == "maemo5": import maemo5 self.platform = maemo5.Maemo5(self, GTK=False) elif args.p == "harmattan": import harmattan self.platform = harmattan.Harmattan(self) else: import pc self.platform = pc.PC(self) else: # no platform provided, decide based on selected GUI if args.u == "hildon": import maemo5 self.platform = maemo5.Maemo5(self) elif args.u == "harmattan": import harmattan self.platform = harmattan.Harmattan(self) else: import pc self.platform = pc.PC(self) # create the GUI startTs1 = timer.start() if args.u == "hildon": self.gui = gui.getGui(self, 'hildon', accel=True, size=initialSize) if args.u == "harmattan" or args.u=='QML': self.gui = gui.getGui(self, 'QML', accel=True, size=initialSize) else: self.gui = gui.getGui(self, 'GTK', accel=True, size=initialSize) timer.elapsed(startTs1, "GUI module import") # # resize the viewport when window size changes # self.gui.resizeNotify(self._resizeViewport) self.activeManga = None # check if a path was specified in the startup arguments if args.o is not None: try: print("loading manga from: %s" % args.o) self.setActiveManga(self.openManga(args.o)) print('manga loaded') except Exception, e: print("loading manga from path: %s failed" % args.o) print(e)