Yuvipanda has submitted this change and it was merged.
Change subject: Support repositories without protocol specified
......................................................................
Support repositories without protocol specified
Change-Id: I14031a47b55c04c52e5c61f09229a0008961d84e
---
M generate.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Yuvipanda: Verified; Looks good to me, approved
diff --git a/generate.py b/generate.py
index 5f845f7..81d8af0 100644
--- a/generate.py
+++ b/generate.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
import argparse
import jinja2
+import re
import requests
@@ -41,8 +42,8 @@
url = package['repository']['url']
if url is not None and 'github.com/' in url:
- parts = url.split('/')
- user_name, repo_name = parts[3], parts[4]
+ parts = re.sub(r'^\w+://', '', url).split('/')
+ user_name, repo_name = parts[1], parts[2]
if repo_name.endswith('.git'):
repo_name = repo_name[:-4]
print 'Fetching starcount for %s/%s' % (user_name, repo_name)
--
To view, visit https://gerrit.wikimedia.org/r/206758
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I14031a47b55c04c52e5c61f09229a0008961d84e
Gerrit-PatchSet: 2
Gerrit-Project: labs/tools/cdnjs-index
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits