예제 #1
0
파일: channel.py 프로젝트: ctogle/msched
 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
예제 #2
0
파일: mcfgstage.py 프로젝트: ctogle/msched
 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)]