コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
    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())
コード例 #4
0
ファイル: parlay_script.py プロジェクト: jedgentry/Parlay
    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())