# HG changeset patch # User Laurent Bessard # Date 1366273289 -7200 # Node ID 978b14147e211f15a4fc3e39c2d85ff6c72a0936 # Parent 0f905e027d186d21778307b7ad10647a325e99e0# Parent a6718197caf25343a03d96d27f975f4032cc4b27 Merged diff -r a6718197caf2 -r 978b14147e21 connectors/PYRO/__init__.py --- a/connectors/PYRO/__init__.py Thu Apr 18 10:19:21 2013 +0200 +++ b/connectors/PYRO/__init__.py Thu Apr 18 10:21:29 2013 +0200 @@ -45,6 +45,7 @@ from util.Zeroconf import Zeroconf r = Zeroconf() i=r.getServiceInfo(service_type, location) + if i is None : raise Exception, "'%s' not found"%location ip = str(socket.inet_ntoa(i.getAddress())) port = str(i.getPort()) newlocation = ip+':'+port diff -r a6718197caf2 -r 978b14147e21 runtime/PLCObject.py --- a/runtime/PLCObject.py Thu Apr 18 10:19:21 2013 +0200 +++ b/runtime/PLCObject.py Thu Apr 18 10:21:29 2013 +0200 @@ -196,6 +196,9 @@ self._GetLogMessage.argtypes = [ctypes.c_uint8, ctypes.c_uint32, ctypes.c_char_p, ctypes.c_uint32, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32)] self._loading_error = None + + self.PythonRuntimeInit() + return True except: self._loading_error = traceback.format_exc() @@ -402,11 +405,8 @@ if self.LoadPLC(): self.PLCStatus = "Stopped" - try: - self.PythonRuntimeInit() - except: - self.PLCStatus = "Broken" else: + self.PLCStatus = "Broken" self._FreePLC() self.StatusChange()