コード例 #1
0
ファイル: __init__.py プロジェクト: allanlei/django-landlord
 def pop(self):
     namespace = self.queue.get_nowait()
     namespace_removed.send(sender=self, namespace=namespace)
     current_namespace = self.get_current_namespace()
     if current_namespace != namespace:
         namespace_changed.send(sender=self, namespace=current_namespace, from_namespace=namespace)
     return namespace
コード例 #2
0
ファイル: __init__.py プロジェクト: allanlei/django-landlord
 def push(self, namespace):
     current_namespace = self.get_current_namespace()
     self.queue.put_nowait(namespace)
     namespace_added.send(sender=self, namespace=namespace)
     if namespace != current_namespace:
         namespace_changed.send(sender=self, namespace=namespace, from_namespace=current_namespace)
     return namespace