Exemple #1
0
def build_commands():
    global command_list
    global command_names
    command_list = [GWhat(), Oobify(), AltCaps()]
    help_cmd = Help(command_list)
    command_list.append(help_cmd)
    command_names = [x.name for x in command_list]
Exemple #2
0
 def __init__(self, s, encoding, change_ff_code):
     self.s = s
     self.flag = change_ff_code
     self.encoding = encoding
     self.name_to_command = {
         "cd": Cd(self.s, encoding, self.flag),
         "delete": Delete(self.s, encoding, self.flag),
         "download": Download(self.s, encoding, self.flag),
         "help": Help(self.s, encoding, self.flag),
         "login": Login(self.s, encoding, self.flag),
         "ls": Ls(self.s, encoding, self.flag),
         "mkdir": Mkdir(self.s, encoding, self.flag),
         "pwd": PWD(self.s, encoding, self.flag),
         "quit": Quit(self.s, encoding, self.flag),
         "?": Help(self.s, encoding, self.flag),
         "upload": Upload(self.s, encoding, self.flag)
     }
    def register_standard_commands(self):
        self.register_command(Quit())
        self.register_command(Attack())
        self.register_command(Check())
        self.register_command(Look())
        self.register_command(Help())
        self.register_command(Inventory())
        self.register_command(Equip())

        self.commands.sort(key=lambda command: command.inputstring)
Exemple #4
0
 def __init__(self, action, *args):
     if action == 'help':
         from commands.help import Help
         Help().call()
     elif action == 'create_dataset':
         from commands.create_dataset import CreateDataset
         CreateDataset(*args).call()
     elif action == 'separate':
         from commands.separate import SeparatePony
         SeparatePony(*args).call()
     else:
         print('Your action was not found')
    def __init__(self):
        print('Bot is online!')

        while True:
            self.get_all_post = get_post()
            Clan(self.get_all_post)
            Player(self.get_all_post)
            Warlog(self.get_all_post)
            Joke(self.get_all_post)
            Help(self.get_all_post)

            time.sleep(60)
Exemple #6
0
from commands.help import Help
from interface_tools.input_tools import *
from commands.bar_graph import BarGraph

bar_graph_command = BarGraph()
help_command = Help()

# load sheet from default location (config.json)

cmd_hist_file = open('commandHistory.txt', 'a+')
user_command_getter = UserCommandGetter(cmd_hist_file)

# program commands
command = {
    "plot": lambda x: bar_graph_command.exec_command(x),
    "help": lambda x: help_command.exec_command(x),
    "exit": lambda x: exit(0),
}


def input_mode():
    # read user input
    args = user_command_getter.get_user_command()
    # args = ['plot-bar-graph', '--yaxis-top', '42']

    if len(args) < 1:
        print("unknown command")
    else:
        if args[0] in command:
            # execute inserted command
            command[args[0]](args)