Exemplo n.º 1
0
 def __init__(self, **kwargs):
     kwargs['ParentEmissionThread'] = None
     self.IsParentEmissionThread = kwargs.get('IsParentEmissionThread', False)
     thread_id = setID(kwargs.get('thread_id'))
     if thread_id in _THREADS:
         newid = '__'.join([thread_id, setID(None)])
         self.LOG.warning('thread_id %s already exists using %s' % (thread_id, newid))
         thread_id = newid
     _THREADS[thread_id] = self
     self.AllowedEmissionThreads = set()
     self.AllowedEmissionThreads |= set(kwargs.get('AllowedEmissionThreads', []))
     self.AllowedEmissionThreads.add(thread_id)
     threading.Thread.__init__(self, name=thread_id)
     OSCBaseObject.__init__(self, **kwargs)
     self._thread_id = thread_id
     self._insertion_lock = Lock()
     self.Events = {}
     timed_events = []
     
     for cls in iterbases(self, 'OSCBaseObject'):
         if not hasattr(cls, '_Events'):
             continue
         for key in cls._Events.iterkeys():
             e = self.Properties[key]
             self.Events[key] = e
             if e.wait_timeout is not None:
                 timed_events.append(e.name)
     self._threaded_calls_idle = True
     timed_events.reverse()
     self.timed_events = timed_events
     self._threaded_calls_queue = collections.deque()
     self._timed_calls_queue = TimeQueue()
     self.disable_threaded_call_waits = kwargs.get('disable_threaded_call_waits', False)
Exemplo n.º 2
0
 def __init__(self, **kwargs):
     self.subcategories = {}
     self.parent = kwargs.get('parent')
     super(Category, self).__init__(**kwargs)
     self.register_signal('obj_update_needed', 'member_update', 'subcategory_added')
     
     if 'deserialize' not in kwargs:
         self.name = kwargs.get('name')
         self.id = setID(kwargs.get('id'))
         self.members_id = kwargs.get('members_id', set())
     if not hasattr(self, 'members'):
         self.members = set()
     if not hasattr(self, 'members_id'):
         self.members_id = set()
Exemplo n.º 3
0
    def __init__(self, **kwargs):
        kwargs['ParentEmissionThread'] = None
        self.IsParentEmissionThread = kwargs.get('IsParentEmissionThread',
                                                 False)
        thread_id = setID(kwargs.get('thread_id'))
        if thread_id in _THREADS:
            newid = '__'.join([thread_id, setID(None)])
            self.LOG.warning('thread_id %s already exists using %s' %
                             (thread_id, newid))
            thread_id = newid
        _THREADS[thread_id] = self
        self.AllowedEmissionThreads = set()
        self.AllowedEmissionThreads |= set(
            kwargs.get('AllowedEmissionThreads', []))
        self.AllowedEmissionThreads.add(thread_id)
        threading.Thread.__init__(self, name=thread_id)
        OSCBaseObject.__init__(self, **kwargs)
        self._thread_id = thread_id
        self._insertion_lock = Lock()
        self.Events = {}
        timed_events = []

        for cls in iterbases(self, 'OSCBaseObject'):
            if not hasattr(cls, '_Events'):
                continue
            for key in cls._Events.iterkeys():
                e = self.Properties[key]
                self.Events[key] = e
                if e.wait_timeout is not None:
                    timed_events.append(e.name)
        self._threaded_calls_idle = True
        timed_events.reverse()
        self.timed_events = timed_events
        self._threaded_calls_queue = collections.deque()
        self._timed_calls_queue = TimeQueue()
        self.disable_threaded_call_waits = kwargs.get(
            'disable_threaded_call_waits', False)
Exemplo n.º 4
0
    def __init__(self, **kwargs):
        self.subcategories = {}
        self.parent = kwargs.get('parent')
        super(Category, self).__init__(**kwargs)
        self.register_signal('obj_update_needed', 'member_update',
                             'subcategory_added')

        if 'deserialize' not in kwargs:
            self.name = kwargs.get('name')
            self.id = setID(kwargs.get('id'))
            self.members_id = kwargs.get('members_id', set())
        if not hasattr(self, 'members'):
            self.members = set()
        if not hasattr(self, 'members_id'):
            self.members_id = set()