class Main(object): def __init__(self): print "Init Main object..." self._mainloop = MainLoop() def run(self): self._mainloop.initialize() running = True frames = 0 print "BinaryClock Main starts running..." while running: try: self._mainloop.update() except (KeyboardInterrupt): running = False del (self._mainloop) print "User aborted..." except (Exception): running = False del (self._mainloop) e = sys.exc_info() t = time n = time.ctime()[11:13] + time.ctime()[14:16] s = str(n).rjust(4) f = file(time.asctime() + ".log", 'w') for l in e: f.write(str(l))
class Main(object): def __init__(self): print "Init Main object..." self._mainloop = MainLoop() self._log = Logger.Logger('main') def run(self): self._mainloop.initialize() running = True frames = 0 while running: try: self._mainloop.update() self._mainloop.draw() print "End of Main..." except Exception as e: running = False print str(e)
class Main(object): def __init__(self): print "Init Main object..." self._mainloop = MainLoop() self._log = Logger.Logger('main') def run(self): self._mainloop.initialize() running=True frames = 0 while running: try: self._mainloop.update() self._mainloop.draw() print "End of Main..." except Exception as e: running = False print str(e)
class Main(object): def __init__(self): print "Init Main object..." self._mainloop = MainLoop() self._log = Logger.Logger('main') def run(self): self._mainloop.initialize() running=True frames = 0 while running: try: frames = frames + 1 self._log.info("Entering main-loop....") self._mainloop.update() #Not all has to be drawn if frames%3==0: self._mainloop.draw() except Exception as e: print str(e)