def get_user_input_from_shell(self):
        """Shell loop that accepts inputs from the command prompt and
        calls corresponding command handlers."""
        while self.alive:
            try:
                input = raw_input(">")
                if len(input) == 0:
                    continue
                else:
                    input = input.split()
                    mname = "cmd_%s" % input[0].lower()
                    try:
                        method = getattr(self, mname)
                    except AttributeError as e:
                        print "Command not supported: ", str(e)
                        continue
                    with self.lock:
                        method(input)
            except KeyboardInterrupt:
                os._exit(0)
            except EOFError:
                return
        return
dataset/ETHPy150Open denizalti/concoord/concoord/node.py/Node.get_user_input_from_shell/original