def append_cmds_processing(cmd, tweet): temp = Command(*command_templates[cmd]) temp.add_tweet(tweet) if len(temp.needed_params) == 0: temp.print_tweets() runner.giveCommand(str(temp)) else: safe_append(command_instances, cmd, temp) safe_append(types_waiting, temp.next_needed_type(), temp)
def supply_arg(self, p, tweet): ''' type of the param has been checked return True if this has been sent to run false if not''' if type(p) == int: p = p%997 self.add_tweet(tweet) self.params.append(p) self.needed_params.pop(0) if len(self.needed_params) == 0: self.print_tweets() runner.giveCommand(str(self)) return True return False