core.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:sslstrip-hsts-openwrt 作者: adde88 项目源码 文件源码
def showPlugins(self):
        """Print list of available plugins.
        """
        import textwrap

        class DummyParser:
            def __init__(self):
                self.options = []
            def add_option(self, *arg, **kw):
                self.options.append((arg, kw.pop('help', '')))

        v = self.config.verbosity
        self.config.plugins.sort()
        for p in self.config.plugins:
            print "Plugin %s" % p.name
            if v >= 2:
                print "  score: %s" % p.score
                print '\n'.join(textwrap.wrap(p.help().strip(),
                                              initial_indent='  ',
                                              subsequent_indent='  '))
                if v >= 3:
                    parser = DummyParser()
                    p.addOptions(parser)
                    if len(parser.options):
                        print
                        print "  Options:"
                        for opts, help in parser.options:
                            print '  %s' % (', '.join(opts))
                            if help:
                                print '\n'.join(
                                    textwrap.wrap(help.strip(),
                                                  initial_indent='    ',
                                                  subsequent_indent='    '))
                print
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号