project-stats

keep track of your projects
git clone https://git.ce9e.org/project-stats.git

commit
9cf318b640d6d388bb8ef0fde6c2d85d76f20f6a
parent
0af2b40246c1470eba68236dd247e73d284716ed
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-03-22 14:27
Gardening

Diffstat

M projects.py 20 +++++++++++---------

1 files changed, 11 insertions, 9 deletions


diff --git a/projects.py b/projects.py

@@ -16,6 +16,8 @@ try:
   16    16 except ImportError:
   17    17     Cheesecake = None
   18    18 
   -1    19 SOURCES = ['github', 'gitorious', 'local', 'pypi', 'bower']
   -1    20 
   19    21 KEYS = [
   20    22     'name',
   21    23     'description',
@@ -316,17 +318,17 @@ def main():
  316   318             project = config['projects'][key]
  317   319             claims = ClaimsDict(KEYS)
  318   320             if not args.list:
  319    -1                 if 'github' in project:
  320    -1                     claims.update(
  321    -1                         get_github(
  322    -1                             project['github'],
  323    -1                             user=config['github']['user'],
  324    -1                             password=config['github']['password']),
  325    -1                         'github')
  326    -1                 for source in ['gitorious', 'local', 'pypi', 'bower']:
   -1   321                 for source in SOURCES:
  327   322                     if source in project:
  328   323                         fn = globals()['get_' + source]
  329    -1                         claims.update(fn(project[source]), source)
   -1   324                         if source == 'github':
   -1   325                             data = fn(
   -1   326                                 project[source],
   -1   327                                 user=config['github']['user'],
   -1   328                                 password=config['github']['password'])
   -1   329                         else:
   -1   330                             data = fn(project[source])
   -1   331                         claims.update(data, source)
  330   332                 print('%s\n%s\n' % (key, claims.format(
  331   333                     indent=2,
  332   334                     short=args.short,