equal
deleted
inserted
replaced
49 try: |
49 try: |
50 return func(*args,**kwargs) |
50 return func(*args,**kwargs) |
51 except PyroError,e: |
51 except PyroError,e: |
52 #pluginsroot.logger.write_error(traceback.format_exc()) |
52 #pluginsroot.logger.write_error(traceback.format_exc()) |
53 pluginsroot.logger.write_error(str(e)+"\n") |
53 pluginsroot.logger.write_error(str(e)+"\n") |
54 pluginsroot._Disconnect() |
54 pluginsroot._connector = None |
55 return default |
55 return default |
56 return catcher_func |
56 return catcher_func |
57 |
57 |
58 # Check connection is effective. |
58 # Check connection is effective. |
59 # lambda is for getattr of GetPLCstatus to happen inside catcher |
59 # lambda is for getattr of GetPLCstatus to happen inside catcher |
109 return self.RemotePLCObjectProxyCopy.GetTraceVariables() |
109 return self.RemotePLCObjectProxyCopy.GetTraceVariables() |
110 else: |
110 else: |
111 return None,None |
111 return None,None |
112 GetTraceVariables = PyroCatcher(_PyroGetTraceVariables,(None,None)) |
112 GetTraceVariables = PyroCatcher(_PyroGetTraceVariables,(None,None)) |
113 |
113 |
114 |
|
115 def __getattr__(self, attrName): |
114 def __getattr__(self, attrName): |
116 member = self.__dict__.get(attrName, None) |
115 member = self.__dict__.get(attrName, None) |
117 if member is None: |
116 if member is None: |
118 def my_local_func(*args,**kwargs): |
117 def my_local_func(*args,**kwargs): |
119 return RemotePLCObjectProxy.__getattr__(attrName)(*args,**kwargs) |
118 return RemotePLCObjectProxy.__getattr__(attrName)(*args,**kwargs) |