Exemplo n.º 1
0
 def setUp(self):
     # TODO: arrange so we don't need to pass as many bogus strings
     self._service = WebService(reactor=the_reactor,
                                http_endpoint='tcp:0',
                                ws_endpoint='tcp:0',
                                root_cap=u'ROOT',
                                cap_table={u'ROOT': SiteStateStub()},
                                title='test title')
     self._service.startService()
     self.url = defaultstr(self._service.get_url())
Exemplo n.º 2
0
 def setUp(self):
     # TODO: arrange so we don't need to pass as many bogus strings
     self._service = WebService(reactor=reactor,
                                http_endpoint='tcp:0',
                                ws_endpoint='tcp:0',
                                root_cap='ROOT',
                                read_only_dbs={},
                                writable_db=DatabaseModel(reactor, {}),
                                root_object=SiteStateStub(),
                                flowgraph_for_debug=gr.top_block(),
                                title='test title')
     self._service.startService()
     self.url = self._service.get_url()
Exemplo n.º 3
0
        def make_service(app):
            # TODO: Temporary glue while we refactor for multisession
            session = app.get_session()
            cap_table = CapTable(lambda bogus: bogus)
            if root_cap is None:
                cap_table.add(session, cap=UNIQUE_PUBLIC_CAP)
                root_cap_subst = UNIQUE_PUBLIC_CAP
            else:
                cap_table.add(session, cap=root_cap)
                root_cap_subst = root_cap

            from shinysdr.i.network.app import WebService
            return WebService(reactor=self.reactor,
                              cap_table=cap_table.as_unenumerable_collection(),
                              http_endpoint=http_endpoint,
                              ws_endpoint=ws_endpoint,
                              root_cap=root_cap_subst,
                              title=title)
Exemplo n.º 4
0
 def make_service(app):
     # TODO: Temporary glue while we refactor for multisession
     session = app.get_session()
     cap_table = CapTable(lambda bogus: bogus)
     if root_cap is None:
         cap_table.add(session, cap=UNIQUE_PUBLIC_CAP)
         root_cap_subst = UNIQUE_PUBLIC_CAP
     else:
         cap_table.add(session, cap=root_cap)
         root_cap_subst = root_cap
     
     from shinysdr.i.network.app import WebService
     return WebService(
         reactor=self.reactor,
         cap_table=cap_table.as_unenumerable_collection(),
         flowgraph_for_debug=app.get_receive_flowgraph(),  # TODO: Once we have the diagnostics or admin page however that turns out to work, this goes away
         read_only_dbs=self.databases._get_read_only_databases(),
         writable_db=self.databases._get_writable_database(),
         http_endpoint=http_endpoint,
         ws_endpoint=ws_endpoint,
         root_cap=root_cap_subst,
         title=title)