Ejemplo n.º 1
0
 def setup_xmlrpc_server(self):
     comm = Communicator()
     self.server = SimpleXMLRPCServer(
         (Communicator.LOCALHOST, comm.com_registry["grids"]),
         logRequests=False,
         allow_none=True)
     self.server.register_function(self.xmlrpc_kill, "kill")
Ejemplo n.º 2
0
 def setup_xmlrpc_server(self):
     self.server_quit = 0
     comm = Communicator()
     self.server = SimpleXMLRPCServer(
         (Communicator.LOCALHOST, comm.com_registry["hmc"]), allow_none=True)
     self.server.register_function(self.xmlrpc_get_message, "get_message")
     self.server.register_function(self.xmlrpc_complete, "complete")
     self.server.register_function(self.xmlrpc_kill, "kill")
Ejemplo n.º 3
0
    def __init__(self, content_loader):
        """
        The Nexus is the 'glue code' of Caster. It is where the things reside which
        manage global state. It is also an access point to those things for other
        things which need them. This access should be limited.
        """

        '''CasterState is used for impl of the asynchronous actions'''

        self.state = CasterState()

        '''rpc class for interacting with Caster UI elements via xmlrpclib'''
        self.comm = Communicator()

        '''tracks both which rules are enabled and the rules' order'''
        rules_config = RulesConfig()

        '''does post-instantiation configuration on selfmodrules'''
        smrc = SelfModRuleConfigurer()

        '''hooks runner: receives and runs events, manages its hooks'''
        hooks_config = HooksConfig()
        hooks_runner = HooksRunner(hooks_config)
        smrc.set_hooks_runner(hooks_runner)

        '''does transformations on rules when rules are activated'''
        transformers_config = TransformersConfig()
        transformers_runner = TransformersRunner(transformers_config)

        '''the ccrmerger -- only merges MergeRules'''
        self._merger = Nexus._create_merger(smrc, transformers_runner)

        '''unified loading mechanism for [rules, transformers, hooks] 
        from [caster starter locations, user dir]'''
        self._content_loader = content_loader

        '''mapping rule maker: like the ccrmerger, but doesn't merge and isn't ccr'''
        mapping_rule_maker = MappingRuleMaker(transformers_runner, smrc)

        '''the grammar manager -- probably needs to get broken apart more'''
        self._grammar_manager = Nexus._create_grammar_manager(self._merger,
            self._content_loader, hooks_runner, rules_config, smrc, mapping_rule_maker,
            transformers_runner)

        '''tracks engine grammar exclusivity and mic states -- TODO Grammar exclusivity should be managed through grammar manager'''
        self._engine_modes_manager = EngineModesManager()

        '''ACTION TIME:'''
        self._load_and_register_all_content(rules_config, hooks_runner, transformers_runner)
        self._grammar_manager.initialize()
        self._engine_modes_manager.initialize()
Ejemplo n.º 4
0
def main():
    server_address = (Communicator.LOCALHOST,
                      Communicator().com_registry["hmc"])
    # Enabled by default logging causes RPC to malfunction when the GUI runs on
    # pythonw.  Explicitly disable logging for the XML server.
    server = SimpleXMLRPCServer(server_address,
                                logRequests=False,
                                allow_none=True)
    app = QApplication(sys.argv)
    window = SettingsDialog(server)
    window.show()
    exit_code = app.exec_()
    server.shutdown()
    sys.exit(exit_code)
Ejemplo n.º 5
0
def main():
    server_address = (Communicator.LOCALHOST,
                      Communicator().com_registry["hmc"])
    # Enabled by default logging causes RPC to malfunction when the GUI runs on
    # pythonw.  Explicitly disable logging for the XML server.
    server = SimpleXMLRPCServer(server_address,
                                logRequests=False,
                                allow_none=True)
    app = App(False)
    SettingsFrame(
        None,
        settings.SETTINGS_WINDOW_TITLE + settings.SOFTWARE_VERSION_NUMBER,
        server)
    app.MainLoop()