Beispiel #1
0
 def setInterpreter(self, klass=None, namespace={}):
     if namespace:
         self.updateNamespace(namespace)
     else:
         namespace = self.namespace
     self.interpreter = EchoInterpreter(self, locals=namespace)
     registry.registerComponent(
         self.interpreter, interfaces.ITerminalWriter)
Beispiel #2
0
def setupLogging(logfile, type=const.LOCAL):
    """
    Set up logging to be Twisted compatible.
    """
    if type == const.LOCAL:
        import logging as log
        log.msg = log.info
        log.basicConfig(filename=logfile, level=log.INFO)
    else:
        from twisted.python import log
    registry.registerComponent(log, interfaces.ILogger)
Beispiel #3
0
 def setInterpreter(self, klass=None, namespace={}):
     if namespace:
         self.updateNamespace(namespace)
     else:
         namespace = self.namespace
     self.interpreter = Interpreter(self, locals=namespace)
     self.interpreter.game = self.game
     # now that we know what's writing the data for the game, we can
     # register the component
     registry.registerComponent(
         self.interpreter, interfaces.ITerminalWriter)
Beispiel #4
0
 def setInterpreter(self):
     self.interpreter = PythonInterpreter(self, locals=self.namespace)
     registry.registerComponent(
         self.interpreter, interfaces.ITerminalWriter)
Beispiel #5
0
 def setInterpreter(self):
     self.interpreter = HyInterpreter(self, locals=self.namespace)
     registry.registerComponent(self.interpreter,
                                interfaces.ITerminalWriter)