Permalink
Browse files

fix title and description not being updated with visitor data

  • Loading branch information...
1 parent dbd2cac commit ba82993f48128f2962038f16eba3b022b9bd1377 @jtuulos jtuulos committed with bitdeli-commits Jan 9, 2013
Showing with 10 additions and 10 deletions.
  1. +10 −10 __main__.py
View
@@ -50,6 +50,13 @@ def popularity(repos):
text['popular'] = max(pop)
text['total'] = sum(visits for visits, repo in pop)
+ Title("Repos have {total} daily unique visitors in total "
+ "over the last {window} days",
+ text)
+ Description("The most popular repository is *{popular[1]}* with "
+ "{popular[0]} visitors.",
+ text)
+
yield {'type': 'text',
'size': (12, 1),
'head': 'Daily Unique Visitors'}
@@ -60,6 +67,9 @@ def popularity(repos):
'data': list(timeline(stats)),
'size': (6, 2)}
else:
+ Title("First badge added!")
+ Description("It takes about an hour for the real data "
+ "to start flowing in.")
yield {'type': 'text',
'size': (12, 1),
'color': 3,
@@ -76,13 +86,3 @@ def popularity(repos):
label='Visitors',
size=(12, 4))
-if 'total' in text:
- Title("Repos have {total} daily unique visitors in total over the last "
- "{window} days",
- text)
- Description("The most popular repository is *{popular[1]}* with "
- "{popular[0]} visitors.",
- text)
-else:
- Title("First badge added!")
- Description("It takes about an hour for the real data to start flowing in.")

0 comments on commit ba82993

Please sign in to comment.