From ef14c4e34d555c62601a00e99a1226fc42e41d00 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 3 Jan 2015 17:58:19 +0100 Subject: [PATCH] Missing file for gitlab --- giturlparse/platforms/__init__.py | 4 ++-- giturlparse/platforms/gitlab.py | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 giturlparse/platforms/gitlab.py diff --git a/giturlparse/platforms/__init__.py b/giturlparse/platforms/__init__.py index 7594145..23f26e1 100644 --- a/giturlparse/platforms/__init__.py +++ b/giturlparse/platforms/__init__.py @@ -4,7 +4,7 @@ from .bitbucket import BitbucketPlatform from .friendcode import FriendCodePlatform from .assembla import AssemblaPlatform -from .gitlab import GitlabPlatform +from .gitlab import GitLabPlatform # Supported platforms @@ -20,4 +20,4 @@ ('base', BasePlatform()), ) -PLATFORMS_MAP = dict(PLATFORMS) \ No newline at end of file +PLATFORMS_MAP = dict(PLATFORMS) diff --git a/giturlparse/platforms/gitlab.py b/giturlparse/platforms/gitlab.py new file mode 100644 index 0000000..4dbcee6 --- /dev/null +++ b/giturlparse/platforms/gitlab.py @@ -0,0 +1,19 @@ +# Imports +from .base import BasePlatform + + +class GitLabPlatform(BasePlatform): + PATTERNS = { + 'https': r'https://(?P.+)/(?P.+)/(?P.+).git', + 'ssh': r'git@(?P.+):(?P.+)/(?P.+).git', + 'git': r'git://(?P.+)/(?P.+)/(?P.+).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' + } + DEFAULTS = { + '_user': 'git' + } +