예제 #1
0
    def __qmark__(self):
        """ user-friendly information when the input is "<bash_fxn>?" """
        name, source = map(str, [self.name, self.source])
        table = [
            ['type:','bash function'],
            ['source:', str(source)],
            ['source name:', name],
            ['smash name:', name],
            ]

        table = tabulate(table) #string from list
        table = table.split('\n')[1:-1] # back to list (removing header/footer)
        table = [ console.blue('  | ') + x for x in table ]
        out = out = [ console.red('Smash-Bash bridge:') ] + table
        return '\n'.join(out)
예제 #2
0
 def __qmark__(self):
     """ user-friendly information when the input is "plugins?" """
     out = [console.red("Smash Plugins: ") + "({0} total)".format(len(self._plugins))]
     for nick in sorted(self._plugins):
         out += [console.blue("   | ") + "{0}".format(nick)]
     return "\n".join(out)