예제 #1
0
파일: events.py 프로젝트: oaubert/advene2
        def exit_no_event_section(self):
            """
            Re-enables all event emission for this object.

            :see-also: `enter_no_event_section`
            """
            self.__disabling_count -= 1
            exit_cs(self)
예제 #2
0
파일: element.py 프로젝트: oaubert/advene2
 def __setattr__(self, name, value):
     """
     Make instance heavier when a new custom attribute is created.
     """
     enter_cs(self)
     if name not in self.__dict__ and not hasattr(self.__class__, name):
         self._increase_weight()
     exit_cs(self)
     super(PackageElement, self).__setattr__(name, value)
예제 #3
0
 def func(use_cs):
     for i in xrange(10):
         if use_cs: enter_cs(d)
         try:
             i = shared[0]
             sleep(.001)
             shared[0] = i+1
         finally:
             if use_cs: exit_cs(d)