class XController(object): def __init__(self, typecode): self.started = False self.probe = ListeningProbe(typecode) if not self.probe.noplaying: self.xiaquery = TagQuery(self.probe.lid, dbfile=DB_FILE) self.crt = Creator(TEMP_DIR, self.probe.lpath) else: raise ControllerError('no current listening') def start(self): self.started = True self.pr1 = self.xiaquery.expandInfo() self.pr2 = self.crt.ensureEnv( self.xiaquery.gettags() ) self.pr3 = self.crt.move() def ahk_display(self): print u'Xiami_controller' if self.started: print self.pr1 print self.pr2 print self.pr3 else: print u'Not Yet Started!'
def start(self): self.started = True for n in range(len(self.probe.playing.lpath)): lpath = self.probe.playing.lpath[n] lid = self.probe.playing.lid[n] q = TagQuery(lid, dbfile=DB_FILE) c = Creator(TEMP_DIR, lpath) q.expandInfo() tags = q.gettags() c.ensureEnv(tags) print n c.move() c.clear() print u'<\t -All Done!- \t>'
def __init__(self, typecode): self.started = False self.probe = ListeningProbe(typecode) if not self.probe.noplaying: self.xiaquery = TagQuery(self.probe.lid, dbfile=DB_FILE) self.crt = Creator(TEMP_DIR, self.probe.lpath) else: raise ControllerError('no current listening')
audio.save(self.lpath) def waitCompletion(self): oz= os.stat(self.lpath).st_size cd = 10 while cd > 0: time.sleep(0.2) nz = os.stat(self.lpath).st_size if nz == oz: cd -= 1 else: oz = nz cd = 10 self.buffered = True if __name__ == '__main__': x = TagQuery('1769948048') x.expandInfo() print "****Module Testing, the result will be display below***" c = Creator('Exp', '1769948048_1879231_l.mp3', x.gettags()) print "---===---Testing tagging ---===---" print c.ensureEnv() print "---===---Testing file move---===---" print c.move()