Пример #1
0
    def do_contributors(self, args):
        """
        Display a list of Mercury contributors.
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("contributors")
            return

        contributors = map(lambda m: Module.get(m).author, Module.all())
        contribution = [
            (c[0], len(list(c[1])))
            for c in itertools.groupby(sorted(flatten(contributors)))
        ]

        self.stdout.write("Core Contributors:\n")
        for contributor in [
                'MWR InfoSecurity (@mwrlabs)',
                'Luander ([email protected])',
                'Rodrigo Chiossi ([email protected])'
        ]:
            self.stdout.write("  %s\n" % contributor)

        self.stdout.write("\nModule Contributors:\n")
        for contributor in sorted(contribution, key=lambda c: -c[1]):
            self.stdout.write("  %s\n" % contributor[0])
Пример #2
0
 def contributors(self):
     """
     Returns a list of module contributors, ordered by the number of modules
     they have authored (in descending order).
     """
     
     contributors = map(lambda m: self.get(m).author, self.all())
     contribution = [(c[0], len(list(c[1]))) for c in itertools.groupby(sorted(flatten(contributors)))]
     
     return map(lambda c: c[0], sorted(contribution, key=lambda c: -c[1]))
Пример #3
0
    def contributors(self):
        """
        Returns a list of module contributors, ordered by the number of modules
        they have authored (in descending order).
        """

        contributors = [self.get(m).author for m in self.all()]
        contribution = [
            (c[0], len(list(c[1])))
            for c in itertools.groupby(sorted(flatten(contributors)))
        ]

        return [c[0] for c in sorted(contribution, key=lambda c: -c[1])]
Пример #4
0
    def do_contributors(self, args):
        """
        Display a list of Mercury contributors.
        """
        argv = shlex.split(args, comments=True)

        if len(argv) == 1 and (argv[0] == "-h" or argv[0] == "--help"):
            self.do_help("contributors")
            return

        contributors = map(lambda m: Module.get(m).author, Module.all())
        contribution = [(c[0], len(list(c[1]))) for c in itertools.groupby(sorted(flatten(contributors)))]

        self.stdout.write("Core Contributors:\n")
        for contributor in ['MWR InfoSecurity (@mwrlabs)', 'Luander ([email protected])', 'Rodrigo Chiossi ([email protected])']:
            self.stdout.write("  %s\n"%contributor)

        self.stdout.write("\nModule Contributors:\n")
        for contributor in sorted(contribution, key=lambda c: -c[1]):
            self.stdout.write("  %s\n"%contributor[0])