Exemplo n.º 1
0
 def openShell(self, proto):
     self.transportFactory(
         proto,
         self.chainedProtocolFactory(),
         iconch.IConchUser(self.original),
         self.width,
         self.height,
     )
Exemplo n.º 2
0
 def openShell(self, proto):
     chainedProtocol = self.chainedProtocolFactory()
     avatar = interfaces.IConchUser(self.original)
     transport = self.transportFactory(proto, chainedProtocol, avatar,
                                       self.width, self.height)
     # XXX this is sensitive information -- we need to make sure that it's
     # not exposed to anyone but admins
     self.users[avatar] = {
         "chainedProtocol": chainedProtocol,
         "transport": transport,
     }
Exemplo n.º 3
0
    def execCommand(self, proto, cmd):
        try:
            chained_protocol = insults.ServerProtocol(BatchOmsShellProtocol)
            self.transportFactory(
                proto, chained_protocol,
                iconch.IConchUser(self.original),
                80, 25)
        except Exception as e:
            print e

        oms_protocol = chained_protocol.terminalProtocol

        @defer.inlineCallbacks
        def spawn_command():
            yield oms_protocol.spawn_commands(cmd)
            if oms_protocol.last_error:
                yield oms_protocol.spawn_command('last_error')
            proto.processEnded()

        spawn_command()