def __init__(self, item_id, name, reactor=None, adapter=None, parents=None): # call parent ThreadedItem.__init__(self, item_id, name, reactor, adapter, parents) self._content_fields = [] self._topic_fields = [] self._properties = {} # Dictionary from name to (attr_name, read_only, write_only) self._datastreams = {} self.item_type = None
def __init__(self, item_id, name, reactor=None, adapter=None): # call parent ThreadedItem.__init__(self, item_id, name, reactor, adapter) self._content_fields = [] self._topic_fields = [] self._properties = {} # Dictionary from name to (attr_name, read_only, write_only) self._datastreams = {} self.item_type = None
def __init__(self, item_id=None, name=None, _reactor=None, adapter=None): if item_id is None: # use the full file path as the ID, default to class name if unknown try: item_id = "script." + os.path.abspath(sys.modules['__main__'].__file__) except: item_id = "script." + self.__class__.__name__ + " (Unknown File)" if name is None: name = self.__class__.__name__ + ".py" # default script name and id to the name of this class ThreadedItem.__init__(self, item_id, name, _reactor, adapter=adapter) if adapter._connected.called: self._reactor.callLater(0, self._start_script) else: adapter._connected.addCallback(lambda _: self._start_script())
def __init__(self, item_id=None, name=None, _reactor=None, adapter=None): if item_id is None: # use the full file path as the ID, default to class name if unknown try: item_id = "script." + os.path.abspath( sys.modules['__main__'].__file__) except: item_id = "script." + self.__class__.__name__ + " (Unknown File)" if name is None: name = self.__class__.__name__ + ".py" # default script name and id to the name of this class ThreadedItem.__init__(self, item_id, name, _reactor, adapter=adapter) if adapter._connected.called: self._reactor.callLater(0, self._start_script) else: adapter._connected.addCallback(lambda _: self._start_script())