def parse_url(self):
        """Parse a git/ssh/http(s) url."""
        url = urlparse(self.url).path

        # handle git
        url = url.split('.git')[0]

        if ':' in url:
            url = url.split(':')[1]

        # Ony capture last two list items
        try:
            project, repo = url.split('/')[-2:]
        except ValueError:
            raise ParserError('"{}" is not a valid repository URL.'.format(self.url))

        return project, repo
def parse_url ( self ) : url = urlparse ( self . url ) . path url = url . split ( '.git' ) [ 0 ] if ':' in url : url = url . split ( ':' ) [ 1 ] try : project , repo = url . split ( '/' ) [ - 2 : ] except ValueError : raise ParserError ( '"{}" is not a valid repository URL.' . format ( self . url ) ) return project , repo
Parse a git/ssh/http(s) url.