Exemplo n.º 1
0
Arquivo: vcs.py Projeto: bozzmob/dxr
 def _construct_upstream_url(self):
     source_urls = self.invoke_vcs(['remote', '-v'], self.root).split('\n')
     for src_url in source_urls:
         name, repo, _ = src_url.split()
         # TODO: Why do we assume origin is upstream?
         if name == 'origin':
             if repo.startswith("[email protected]:"):
                 return "https://github.com/" + repo[len("[email protected]:"):]
             elif repo.startswith(("git://github.com/", "https://github.com/")):
                 repo = without_ending('.git', repo)
                 if repo.startswith("git:"):
                     repo = "https" + repo[len("git"):]
                 return repo
             warn("Your git remote is not supported yet. Please use a "
                  "GitHub remote if you would like version control "
                  "naviagtion links to show.")
             break
Exemplo n.º 2
0
Arquivo: vcs.py Projeto: kleintom/dxr
 def _construct_upstream_url(self):
     source_urls = self.invoke_vcs(['remote', '-v'], self.root).split('\n')
     for src_url in source_urls:
         if not src_url:
             continue
         name, repo, _ = src_url.split()
         # TODO: Why do we assume origin is upstream?
         if name == 'origin':
             if repo.startswith("[email protected]:"):
                 return "https://github.com/" + repo[len("[email protected]:"):]
             elif repo.startswith(("git://github.com/", "https://github.com/")):
                 repo = without_ending('.git', repo)
                 if repo.startswith("git:"):
                     repo = "https" + repo[len("git"):]
                 return repo
             warn("Your git remote is not supported yet. Please use a "
                  "GitHub remote if you would like version control "
                  "naviagtion links to show.")
             break
Exemplo n.º 3
0
 def __new__(metaclass, name, bases, dict):
     dict['id'] = without_ending('Ref', name)
     return type.__new__(metaclass, name, bases, dict)
Exemplo n.º 4
0
 def __new__(metaclass, name, bases, dict):
     dict['id'] = without_ending('Ref', name)
     return type.__new__(metaclass, name, bases, dict)