예제 #1
0
파일: server.py 프로젝트: bagamernew/labs
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
예제 #2
0
파일: client.py 프로젝트: bagamernew/labs
 def cls(self):
     command.cls()
예제 #3
0
파일: client.py 프로젝트: bagamernew/labs
        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:]