forked from nephila/giturlparse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub.py
More file actions
21 lines (18 loc) · 724 Bytes
/
Copy pathgithub.py
File metadata and controls
21 lines (18 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from .base import BasePlatform
class GitHubPlatform(BasePlatform):
PATTERNS = {
'https': r'https://(?P<domain>.+)/(?P<owner>.+)/(?P<repo>.+?)(?:\.git)?$',
'ssh': r'git@(?P<domain>.+):(?P<owner>.+)/(?P<repo>.+?)(?:\.git)?$',
'git': r'git://(?P<domain>.+)/(?P<owner>.+)/(?P<repo>.+?)(?:\.git)?$',
}
FORMATS = {
'https': r'https://%(domain)s/%(owner)s/%(repo)s.git',
'ssh': r'git@%(domain)s:%(owner)s/%(repo)s.git',
'git': r'git://%(domain)s/%(owner)s/%(repo)s.git'
}
DOMAINS = ('github.com', 'gist.github.com',)
DEFAULTS = {
'_user': 'git'
}