Beispiel #1
0
    def createCLI(self):
        cli = CLI(self.num)
        # cli.logging(False)
        cli.log('Starting Up')

        # this maps the CLI looks pretty
        time.sleep(1)
        cli.log('Loading 3...')
        time.sleep(1)
        cli.log('Loading 2...')
        time.sleep(1)
        cli.log('Loading 1...')
        time.sleep(1)

        # pass details
        cli.defineMapperOne(5001 + (self.num - 1) * 10, self.ip)
        cli.defineMapperTwo(5002 + (self.num - 1) * 10, self.ip)
        cli.defineReducer(5003 + (self.num - 1) * 10, self.ip)
        cli.definePRM(5004 + (self.num - 1) * 10, self.ip)

        cli.log('Enter commands below. Use ctrl+c to exit.')
        boo = True
        while (boo):
            try:
                command = raw_input('> ')
                cli.handleCommand(command.split())
            except KeyboardInterrupt:
                boo = False
            time.sleep(1)

        # exiting
        cli.log('Exiting')