Mercurial > code > home > repos > light9
changeset 790:690c837f8842
logging
Ignore-this: ca7fe09d0d31f46f92e6ec6160934b76
author | drewp@bigasterisk.com |
---|---|
date | Mon, 18 Jun 2012 04:51:08 +0000 |
parents | ea8ca6502255 |
children | 44cad4444def |
files | light9/Effects.py light9/curvecalc/subtermview.py |
diffstat | 2 files changed, 13 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/Effects.py Mon Jun 18 01:34:40 2012 +0000 +++ b/light9/Effects.py Mon Jun 18 04:51:08 2012 +0000 @@ -1,11 +1,13 @@ from __future__ import division from random import Random +import logging import light9.Submaster as Submaster from chase import chase as chase_logic import showconfig from rdflib import RDF from light9 import Patch from light9.namespaces import L9 +log = logging.getLogger() def chase(t, ontime=0.5, offset=0.2, onval=1.0, offval=0.0, names=None, combiner=max, random=False): @@ -22,8 +24,8 @@ try: dmx = Patch.dmx_from_uri(uri) except KeyError: - print ("chase includes %r, which doesn't resolve to a dmx chan" % - uri) + log.info(("chase includes %r, which doesn't resolve to a dmx chan" % + uri)) continue lev[dmx] = value @@ -43,8 +45,8 @@ try: dmx = Patch.dmx_from_uri(uri) except KeyError: - print ("stack includes %r, which doesn't resolve to a dmx chan"% - uri) + log.info(("stack includes %r, which doesn't resolve to a dmx chan"% + uri)) continue lev[dmx] = 1 else:
--- a/light9/curvecalc/subtermview.py Mon Jun 18 01:34:40 2012 +0000 +++ b/light9/curvecalc/subtermview.py Mon Jun 18 04:51:08 2012 +0000 @@ -1,9 +1,10 @@ -import gtk +import gtk, logging from louie import dispatcher from rdflib import RDF, RDFS, Literal from light9 import Submaster from light9.namespaces import L9 from light9.curvecalc.subterm import Subterm, Subexpr +log = logging.getLogger() # inspired by http://www.daa.com.au/pipermail/pygtk/2008-August/015772.html # keeping a ref to the __dict__ of the object stops it from getting zeroed @@ -30,7 +31,7 @@ sender=self.subexpr) dispatcher.connect(self.exprError, "expr_error", sender=self.subexpr) - print "made", id(self), self.__dict__ + log.info("made %r %r" % (id(self), self.__dict__)) keep.append(self.__dict__) def exprError(self, exc): @@ -58,11 +59,11 @@ def add_one_subterm(graph, subUri, curveset, subterms, master, expr=None, show=False): subname = graph.label(subUri) - print "%s's label is %s" % (subUri, subname) + log.info("%s's label is %s" % (subUri, subname)) if not subname: # fake sub, like for a chase st = graph.subjects(L9['sub'], subUri).next() subname = graph.label(st) - print "using parent subterm's name instead. parent %r, name %r" % (st, subname) + log.info("using parent subterm's name instead. parent %r, name %r" % (st, subname)) assert subname, "%s has no name" % subUri if expr is None: expr = '%s(t)' % subname @@ -93,12 +94,12 @@ vp = widgetInRow while vp.get_name() != 'GtkViewport': - print "walk", vp.get_name() + log.info("walk %s", vp.get_name()) vp = vp.get_parent() adj = vp.props.vadjustment def firstExpose(widget, event, adj, widgetInRow): - print "scroll", adj.props.value + log.info("scroll %s", adj.props.value) adj.props.value = adj.props.upper widgetInRow.disconnect(handler)