- commit
- be21d6908d7b77d568d2dbac1113b8a5bee43f2c
- parent
- 00e7db2fa05b8717acce693886a8f09131bb2b8a
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-12-13 11:08
drop support for gitorious
Diffstat
| M | project_stats.py | 21 | +-------------------- |
1 files changed, 1 insertions, 20 deletions
diff --git a/project_stats.py b/project_stats.py
@@ -3,7 +3,6 @@ from __future__ import print_function 3 3 from __future__ import unicode_literals 4 4 5 5 from functools import total_ordering6 -1 from xml.etree import ElementTree7 6 import argparse 8 7 import json 9 8 import logging @@ -23,7 +22,7 @@ try: 23 22 except ImportError: 24 23 Cheesecake = None 25 2426 -1 SOURCES = ['github', 'gitorious', 'gitlab', 'local', 'pypi', 'bower', 'travis']-1 25 SOURCES = ['github', 'gitlab', 'local', 'pypi', 'bower', 'travis'] 27 26 28 27 KEYS = [ 29 28 'name', @@ -187,12 +186,6 @@ def get_json(url, user=None, password=None): 187 186 return req.json() 188 187 189 188190 -1 @ttl_cache('xi-projects', ttl=3600)191 -1 def get_xml(url):192 -1 req = requests.get(url)193 -1 return ElementTree.fromstring(req.content)194 -1195 -1196 189 def get_github(url, user=None, password=None): 197 190 def _get_json(url): 198 191 data = get_json(url, user=user, password=password) @@ -243,18 +236,6 @@ def get_github(url, user=None, password=None): 243 236 } 244 237 245 238246 -1 def get_gitorious(url):247 -1 api_url = url.rstrip('/') + '.xml'248 -1 data = get_xml(api_url)249 -1250 -1 return {251 -1 'description': data.find('description').text,252 -1 'name': data.find('name').text,253 -1 'created': dt.parse(data.find('created-at').text),254 -1 'updated': dt.parse(data.find('last-pushed-at').text),255 -1 }256 -1257 -1258 239 def get_gitlab(_id, token=None): 259 240 api_url = 'https://gitlab.com/api/v3/projects/' + _id 260 241 if token is not None: