示例#1
0
def on():
    utt.on
    utt.scale = 5
    prints = (
        #'gaussian',
        #'gaussian_pt',
        'SimpleGaussianTrainer',
        'ddt_accum',
        )
    db=DebugPrint(logstream, *prints)
    db.on()
    audio.on
示例#2
0
class DpToggle(object):
    """
    An object with two attributes, on and off, that toggle debug printing
    of the DebugPrint object created from the constructor args.
    """
    # XXX DebugPrint needs work to develop semantics to support multiple
    # instances of DpToggle....
    def __init__(self, *args):
        self.dp_control = DebugPrint(*args)
        self._on = False
    def __del__(self):
        self.off
    @property
    def on(self):
        if not self._on:
            self._on = True
            self.dp_control.on()
            return 'on'
    @property
    def off(self):
        if self._on:
            self._on = False
            self.dp_control.off()
            return 'off'