def _general_help(self, ret=False): string = """Press <TAB> twice or do "%s" to see list of commands.""" % bold('help commands', white) if ret: return string print string
def _handle_stream_exception(self, e): s = ": invalid syntax (chr %d): " % e.stream.character_offset slen = len(s) + 5 s = bold("Error", red) + s print s + bold(e.stream.location[3], white) print ' '*slen + ' '*e.stream.character_offset + bold("^", red)
def prompt(): parser = CommandParser() intro = "iris shell version: %s\n%s" % (bold(version, white), parser._general_help(True)) parser.cmdloop(intro)