- commit
- 79502ba501fa81eab5abdb5d09c6daeb1ae610ee
- parent
- 1c19a56825dd3e99846c0a5954d0116a3ab9522f
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2017-07-23 19:28
rm bower support
Diffstat
| M | README.rst | 2 | +- |
| M | project_stats.py | 42 | +----------------------------------------- |
2 files changed, 2 insertions, 42 deletions
diff --git a/README.rst b/README.rst
@@ -1,6 +1,6 @@ 1 1 project-stats can be used to keep track of all the projects you are involved 2 2 in. It collects data from several on- and offline data sources (e.g. git,3 -1 github, pypi, bower) and combines them in a short report.-1 3 github, pypi, npm) and combines them in a short report. 4 4 5 5 installation 6 6 ------------
diff --git a/project_stats.py b/project_stats.py
@@ -19,7 +19,7 @@ except ImportError: 19 19 20 20 __version__ = '1.1.1' 21 2122 -1 SOURCES = ['github', 'gitlab', 'local', 'pypi', 'bower', 'npm', 'travis']-1 22 SOURCES = ['github', 'gitlab', 'local', 'pypi', 'npm', 'travis'] 23 23 24 24 KEYS = [ 25 25 'name', @@ -163,31 +163,6 @@ def cheesecake_index(name): 163 163 164 164 165 165 @asyncio.coroutine166 -1 def get_bower_info(name):167 -1 process = yield from asyncio.create_subprocess_exec(168 -1 'bower', 'info', name,169 -1 stdout=asyncio.subprocess.PIPE,170 -1 stderr=asyncio.subprocess.PIPE)171 -1 stdout, stderr = yield from process.communicate()172 -1 if process.returncode != 0:173 -1 return174 -1 s = stdout.decode('utf8')175 -1176 -1 # re handles \n specially, so it is replaced by \t177 -1 s = '\t'.join(s.splitlines())178 -1179 -1 # strip uninteresting information180 -1 s = re.sub('.*\t{', '{', s)181 -1 s = re.sub('\t}.*', '\t}', s)182 -1183 -1 # this is Javascript object syntax, not strict JSON184 -1 s = re.sub('\t( *)([a-z]*): ', '\t\\1"\\2": ', s)185 -1 s = s.replace('\'', '"')186 -1187 -1 return json.loads(s)188 -1189 -1190 -1 @asyncio.coroutine191 166 def get_json(url, user=None, password=None): 192 167 assert not (user is None) ^ (password is None) 193 168 @@ -324,21 +299,6 @@ def get_pypi(url): 324 299 325 300 326 301 @asyncio.coroutine327 -1 def get_bower(name):328 -1 data = yield from get_bower_info(name)329 -1 if data is None:330 -1 return {}331 -1 else:332 -1 return {333 -1 'name': data['name'],334 -1 'version': data.get('version'),335 -1 'homepage': data.get('homepage'),336 -1 'description': data.get('description'),337 -1 'license': data.get('license'),338 -1 }339 -1340 -1341 -1 @asyncio.coroutine342 302 def get_npm(name): 343 303 process = yield from asyncio.create_subprocess_exec( 344 304 'npm', 'view', name,