示例#1
0
文件: gitlab.py 项目: W00t3k/Gitmails
 def get_collaborators(self, repos):
     if repos:
         if self.args.verbose:
             Helpers().print_success("Collecting authors")
         if self.args.api:
             [
                 repo.set_authors(
                     self.repository_collaborators(repo.identifier))
                 for repo in repos
             ]
         else:
             GitUtils(self.args).set_repos_authors(repos)
         return True
     return False
示例#2
0
 def execute(self):
     if self.args.repository:
         Helpers().print_success("Collecting information for {}".format(
             self.args.repository))
         collected = GitUtils(self.args).get_repo_authors_by_url(
             self.args.repository)
     else:
         collected = self.collect(self.get_collectors())
     if not collected:
         sys.exit(3)
     Printer(self.args).print(collected)
     if self.args.file:
         authors_to_print = collected
         if not self.args.repository:
             authors_to_print = Parser(
                 self.args).get_collected_authors(collected)
         Helpers().write_authors_file(self.args.file, collected)
     if self.args.run_plugins and not self.args.repository:
         self.apply_plugins(self.get_plugins(), collected)
     return collected
示例#3
0
 def set_authors(self, repos):
     if self.args.verbose:
         Helpers().print_success("Collecting authors")
     return GitUtils(self.args).set_repos_authors(repos)