Пример #1
0
 def collect_organization(self, organization):
     Helpers().print_success("Collecting information of {} in Bitbucket".format(organization))
     url = "{}/teams/{}".format(self.base_url, organization)
     result = Helpers().request(url)
     if result:
         repos = self.collect_repositories("{}/teams/{}/repositories".format(self.base_url, organization))
         return Organization(result["display_name"], None, result["website"], repos, None)
     return False
Пример #2
0
 def collect_organization(self, organization):
     Helpers().print_success(
         "Collecting information of {} in Gitlab".format(organization))
     url = "{}/groups/{}".format(self.base_url, organization)
     result = Helpers().request(url)
     if result:
         repos = self.parse_repositories(result["projects"])
         self.get_collaborators(repos)
         return Organization(result["full_name"], None, None, repos, None)
     return False
Пример #3
0
 def collect_organization(self, organization):
     email = None
     blog = None
     name = None
     Helpers().print_success(
         "Collecting information of {} in Github".format(organization))
     url = "{}/orgs/{}".format(self.base_url, organization)
     result = Helpers().request(url)
     if result:
         members = self.collect_members("{}/members".format(url))
         repos = self.collect_repositories("{}/repos".format(url))
         if "email" in result:
             email = result["email"]
         if "blog" in result:
             blog = result["blog"]
         if "name" in result:
             name = result["name"]
         else:
             name = result["login"]
         return Organization(name, email, blog, repos, members)
     pass
Пример #4
0
    def get_or_create_dummy(cls, domain_name='example.com'):
        from core.models.organization import Organization
        organization, unused = Organization.get_or_create_dummy()

        return cls.objects.get_or_create(domain_name=domain_name, defaults=dict(organization=organization))
Пример #5
0
    def get_or_create_dummy(cls, domain_name='example.com'):
        from core.models.organization import Organization
        organization, unused = Organization.get_or_create_dummy()

        return cls.objects.get_or_create(domain_name=domain_name, defaults=dict(organization=organization))