Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(21)  |  Call(19)  |  Derive(0)  |  Import(2)
NotificationCentre is used to send notifications between controllers,
and to queue notifications for the client.

src/h/e/helio-1.0.0b1/helio/viewstate/viewstate.py   helio(Download)
def get_default_viewstate():
    from notification import NotificationCentre
    root = init_controller(DEFAULT_ROOT_COMPONENT)
    vs = ViewState(root)
    NotificationCentre(vs)

src/h/e/helio-1.0.0b1/helio/viewstate/notification_tests.py   helio(Download)
import unittest
from mock import MagicMock
from notification import NotificationCentre
from viewstate import ViewState
 
 
        with self.assertRaises(TypeError):
            NotificationCentre(None)
 
        with self.assertRaises(TypeError):
            NotificationCentre(not_a_viewstate)
    def test_viewstate_cannot_be_set(self):
        """ViewState is read only and can not be set once the NC is instantiated."""
        v = ViewState(MagicMock())
        n = NotificationCentre(v)
        new_v = ViewState(MagicMock())
    def test_viewstate_read(self):
        """ViewState can be read from the NC."""
        v = ViewState(MagicMock())
        n = NotificationCentre(v)
        self.assertEqual(v, n.view_state)