Example #1
0
    },
    "upnp": {
        "max-age": "1800",
    },
    "ui": {
        "port": "8877",
    },
}

class ErrorHandler(Component):
    def exception(self, error_type, value, traceback, handler=None):
        sys.exit();

if __name__ == '__main__':

    application = Application("CoCy", CONFIG)
    Debugger().register(application)
    ErrorHandler().register(application)
    
#    # Build a portal as user interface
#    port = int(application.config.get("ui", "port", 0))
#    portal_server = BaseServer(("", port), channel="ui").register(application)
#    portal = Portal(portal_server, title="CoCy").register(application)
#    PortletsFactory().register(application)
#    dev_dir = UPnPDeviceDirectory().register(application)

    # The server    
    upnp_dev_server \
        = UPnPDeviceServer(application.app_dir).register(application)
    media_renderer = DummyPlayer().register(application)
    
Example #2
0
        "max-age": "1800",
    },
    "ui": {
        "port": "8877",
    },
}


class ErrorHandler(Component):
    def exception(self, error_type, value, traceback, handler=None):
        sys.exit()


if __name__ == '__main__':

    application = Application("CoCy", CONFIG)
    Debugger().register(application)
    ErrorHandler().register(application)

    # Build a portal as user interface
    port = int(application.config.get("ui", "port", 0))
    portal_server = BaseServer(("", port), channel="ui").register(application)
    portal = Portal(portal_server, title="CoCy").register(application)
    PortletsFactory().register(application)
    dev_dir = UPnPDeviceDirectory().register(application)

    # The light server
    upnp_dev_server \
        = UPnPDeviceServer(application.app_dir).register(application)
    binary_light = BinaryLight().register(application)
    BinaryLightPortlet(binary_light).register(portal)
Example #3
0
        "backupCount": 7,
        "level": "DEBUG",
    },
    "ui": {
        "port": "8123",
    },
}

class ErrorHandler(Component):
    def exception(self, error_type, value, traceback, \
                  handler=None, fevent=None):
        sys.exit();

if __name__ == '__main__':

    application = Application("TestPortal", CONFIG)
    Debugger().register(application)
    ErrorHandler().register(application)
    # Build a web (HTTP) server for handling user interface requests.
    port = int(application.config.get("ui", "port", 0))
    portal_server = BaseServer(("0.0.0.0", port), channel="ui") \
        .register(application)
    Portal(portal_server, title="Test Portal").register(application)
    HelloWorldPortlet().register(application)
    DisplayPortlet(channel="sample-display").register(application)
    ServerTimePortlet().register(application)
    
    from circuits.tools import graph
    print(graph(application))
    application.run()