def recv(self,a,p = None): if a == 'prompt': if p is None:p = '' i = tl.prompt(self.pmsg % p) else: f,r = self.freq,self.root if a == 'active':i = tl.pollrecv(f,r) elif a == 'passive':i = tl.passrecv(f,r) else:tl.log(3,amsg,a) return i
def form(self,state): defmcfg = state['controller'].smngr.get('defaultmcfg') defmpath = tl.datpath(os.path.join('mcfgdata',defmcfg)) if not os.path.exists(defmpath): mfile = tl.prompt('\n\n\tmcfg filename? :: >> ') else:mfile = defmcfg mpath = tl.datpath(os.path.join('mcfgdata',mfile)) if not os.path.exists(mpath): lmsg = 'mcfgstage.form()->mcfg file not found: %s' logging.warning(lmsg,mfile) return [] state['stageform'] = {} state['stageform']['mpath'] = mpath with open(mpath) as mh:mstr = mh.read() tl.log(2,'INPUT MCFGSTRING',mstr) return [(self.name,mstr)]