Mercurial > code > home > repos > light9
comparison bin/curvecalc @ 319:2193eab0650b
add startup logging to curvecalc
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Fri, 16 Jun 2006 19:34:30 +0000 |
parents | e99bd20dad85 |
children | a3267d8c498e |
comparison
equal
deleted
inserted
replaced
318:fcf9755d9a75 | 319:2193eab0650b |
---|---|
10 import Tkinter as tk | 10 import Tkinter as tk |
11 from dispatch import dispatcher | 11 from dispatch import dispatcher |
12 from twisted.internet import reactor,tksupport | 12 from twisted.internet import reactor,tksupport |
13 import twisted | 13 import twisted |
14 from twisted.web.xmlrpc import Proxy | 14 from twisted.web.xmlrpc import Proxy |
15 import logging | |
16 log = logging.getLogger() | |
17 logging.basicConfig(format="%(asctime)s %(levelname)-5s %(name)s %(filename)s:%(lineno)d: %(message)s") | |
18 log.setLevel(logging.DEBUG) | |
15 | 19 |
16 import run_local | 20 import run_local |
17 from light9 import Submaster, dmxclient, networking, showconfig | 21 from light9 import Submaster, dmxclient, networking, showconfig |
18 from light9.TLUtility import make_attributes_from_args, dict_subset | 22 from light9.TLUtility import make_attributes_from_args, dict_subset |
19 from light9.zoomcontrol import Zoomcontrol | 23 from light9.zoomcontrol import Zoomcontrol |
319 try: | 323 try: |
320 song = args[0] | 324 song = args[0] |
321 except IndexError: | 325 except IndexError: |
322 raise SystemExit("song name is required, e.g. '05-mix'") | 326 raise SystemExit("song name is required, e.g. '05-mix'") |
323 | 327 |
328 log.debug("music") | |
324 music=Music() | 329 music=Music() |
325 | 330 |
326 zc = Zoomcontrol(root) | 331 zc = Zoomcontrol(root) |
327 zc.pack(side='top',fill='x') | 332 zc.pack(side='top',fill='x') |
328 | 333 |
345 sub_commands_tk(root, curveset, subterms, root, ssv).pack(side='top',fill='x') | 350 sub_commands_tk(root, curveset, subterms, root, ssv).pack(side='top',fill='x') |
346 | 351 |
347 add_subterms_from_file(showconfig.subtermsForSong(song), | 352 add_subterms_from_file(showconfig.subtermsForSong(song), |
348 curveset, subterms, root, ssv) | 353 curveset, subterms, root, ssv) |
349 | 354 |
355 log.debug("output") | |
350 out = Output(subterms, music) | 356 out = Output(subterms, music) |
351 | 357 |
352 def savekey(*args): | 358 def savekey(*args): |
353 print "saving",song | 359 print "saving",song |
354 savesubterms(showconfig.subtermsForSong(song),subterms) | 360 savesubterms(showconfig.subtermsForSong(song),subterms) |
371 | 377 |
372 root.bind("<Control-Key-q>",lambda ev: reactor.stop) | 378 root.bind("<Control-Key-q>",lambda ev: reactor.stop) |
373 root.bind("<Destroy>",lambda ev: reactor.stop) | 379 root.bind("<Destroy>",lambda ev: reactor.stop) |
374 root.protocol('WM_DELETE_WINDOW', reactor.stop) | 380 root.protocol('WM_DELETE_WINDOW', reactor.stop) |
375 tksupport.install(root,ms=20) | 381 tksupport.install(root,ms=20) |
382 log.debug("run") | |
376 if 0: | 383 if 0: |
377 sys.path.append("/home/drewp/projects/cuisine/pour") | 384 sys.path.append("/home/drewp/projects/cuisine/pour") |
378 from utils import runstats | 385 from utils import runstats |
379 runstats("reactor.run()") | 386 runstats("reactor.run()") |
380 else: | 387 else: |