Skip to content

Commit

Permalink
support color
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Dec 28, 2014
1 parent 5a5c8b9 commit 1423fe1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/coverage_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ def get(self, project):
try:
with open('/tmp/%s-coverage' % project, 'rb') as f:
coverage = f.read().strip()
n = int(coverage.strip('%'))
if n > 80:
color = 'brightgreen'
else:
color = 'yellow'
self.redirect(('https://img.shields.io/badge/'
'coverage-%s-brightgreen.svg'
'coverage-%s-%s.svg'
'?style=flat') %
urllib.quote(coverage))
(urllib.quote(coverage), color))
except IOError:
raise tornado.web.HTTPError(404)

Expand Down

0 comments on commit 1423fe1

Please sign in to comment.