def handle_colors(self, world, text): """ Prints out all the colors we know about.""" response = '' for background in range(40,48): for foreground in range(30,38): response += color(str(foreground), foreground, background) response += color(str(foreground), foreground, background, 1) response += "\33[0m\n" self.write(response)
def handle_colors(self, world, text): """ Prints out all the colors we know about.""" response = '' for background in range(40, 48): for foreground in range(30, 38): response += color(str(foreground), foreground, background) response += color(str(foreground), foreground, background, 1) response += "\33[0m\n" self.write(response)
def handleInput(self, world, input): comm = input.split(" ", 1)[0] if ("handle_%s" % comm) in self._dir: exec ( "self.handle_%s(world, input)" % comm) else: # CATCH ALL for bad commands self.write(color("huh? '%s'\n" % input, 35)) self.write("> ")
def handleInput(self, world, input): comm = input.split(" ", 1)[0] if ("handle_%s" % comm) in self._dir: exec("self.handle_%s(world, input)" % comm) else: # CATCH ALL for bad commands self.write(color("huh? '%s'\n" % input, 35)) self.write("> ")