LPCBeremiz.py
changeset 552 ab7916df0de7
parent 551 d18e86b603bc
child 553 d071efd2a94b
equal deleted inserted replaced
551:d18e86b603bc 552:ab7916df0de7
   868             self.PluginRoot._connector = None
   868             self.PluginRoot._connector = None
   869         
   869         
   870         self.PluginRoot.KillDebugThread()
   870         self.PluginRoot.KillDebugThread()
   871         self.KillLocalRuntime()
   871         self.KillLocalRuntime()
   872         
   872         
   873         print "Closed"
   873         lpcberemiz_cmd.Log.write("Closed\n")
   874         sys.stdout.flush()
       
   875         
   874         
   876         event.Veto()
   875         event.Veto()
   877 
   876 
   878     def ShowProperties(self):
   877     def ShowProperties(self):
   879         old_values = self.Controler.GetProjectProperties()
   878         old_values = self.Controler.GetProjectProperties()
  1063 class StdoutPseudoFile:
  1062 class StdoutPseudoFile:
  1064     
  1063     
  1065     def __init__(self, port):
  1064     def __init__(self, port):
  1066         self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  1065         self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  1067         self.socket.connect(('localhost', port))
  1066         self.socket.connect(('localhost', port))
       
  1067         self.Buffer = ""
  1068     
  1068     
  1069     def __del__(self):
  1069     def __del__(self):
  1070         self.socket.close()
  1070         self.socket.close()
  1071     
  1071     
  1072     def readline(self):
  1072     def readline(self):
  1073         return self.socket.recv(2048)
  1073         idx = self.Buffer.find("\n")
       
  1074         if idx == -1:
       
  1075             self.Buffer += self.socket.recv(2048)
       
  1076             idx = self.Buffer.find("\n")
       
  1077         if idx != -1:
       
  1078             line = self.Buffer[:idx+1]
       
  1079             self.Buffer = self.Buffer[idx+1:]
       
  1080             return line
       
  1081         return ""
  1074     
  1082     
  1075     """ Base class for file like objects to facilitate StdOut for the Shell."""
  1083     """ Base class for file like objects to facilitate StdOut for the Shell."""
  1076     def write(self, s, style = None):
  1084     def write(self, s, style = None):
  1077         if s != '':
  1085         if s != '':
  1078             self.socket.send(s)
  1086             self.socket.send(s)