예제 #1
0
 def serve_one(self):
     cmd = self.fin.readline()[:-1]
     if cmd and cmd in wireproto.commands:
         rsp = wireproto.dispatch(self.repo, self, cmd)
         self.handlers[rsp.__class__](self, rsp)
     elif cmd:
         impl = getattr(self, 'do_' + cmd, None)
         if impl:
             r = impl()
             if r is not None:
                 self.sendresponse(r)
         else: self.sendresponse("")
     return cmd != ''
예제 #2
0
 def serve_one(self):
     cmd = self.fin.readline()[:-1]
     if cmd and cmd in wireproto.commands:
         rsp = wireproto.dispatch(self.repo, self, cmd)
         self.handlers[rsp.__class__](self, rsp)
     elif cmd:
         impl = getattr(self, 'do_' + cmd, None)
         if impl:
             r = impl()
             if r is not None:
                 self.sendresponse(r)
         else: self.sendresponse("")
     return cmd != ''