Beispiel #1
0
def main():
    header = """
     ______________________________________________________
    |                                                      |
    | Command Pattern - Server                             |
    |          . . . . . . .         __________            |
    |          .           . -----> |          |           |
    |          .           . <----- |          |           |
    |          . . . . . . .        |__________|           |
    |                                                      |
    | Author: Marcus Ottosson <*****@*****.**>  |
    |______________________________________________________|

Running @ local:  {local}:5555""".format(local=command.get_local_ip())

    command.cls()
    print header

    thread = threading.Thread(target=server)
    thread.daemon = True
    thread.start()

    try:
        while True:
            time.sleep(1)

    except KeyboardInterrupt:
        pass
Beispiel #2
0
 def cls(self):
     command.cls()
Beispiel #3
0
        else:
            for i in xrange(len(self.FUTURE)):
                command_id = self.FUTURE[i]
                print "    %i: (%s)" % (i, command_id)

    def cls(self):
        command.cls()

    def exit(self):
        raise KeyboardInterrupt


if __name__ == '__main__':
    """Client ('customer')"""
    import sys
    command.cls()

    try:
        invoker = Invoker(*sys.argv[1:])

    except command.Connection as e:
        print e

    else:
        try:
            while True:
                command.init_shell()
                input_ = raw_input()

                parts = input_.split()
                cmd, args = parts[0], parts[1:]