From 3db4c7fd55717bf3e13f3287910033b9686155f2 Mon Sep 17 00:00:00 2001 From: Thaddee Tyl Date: Mon, 21 Jul 2014 15:56:15 +0200 Subject: [PATCH] PyPI license: Example and color adjustments. To fit with other licenses. --- index.html | 9 ++++----- server.js | 5 ++--- try.html | 4 ++++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index af1b77e..35884fc 100644 --- a/index.html +++ b/index.html @@ -123,6 +123,10 @@ I made the GitHub Badge Service. http://img.shields.io/npm/l/express.svg + PyPI: + + http://img.shields.io/pypi/l/Django.svg + CocoaPods: http://img.shields.io/cocoapods/l/AFNetworking.svg @@ -131,11 +135,6 @@ I made the GitHub Badge Service. http://img.shields.io/cocoapods/p/AFNetworking.svg - PyPI (License): - - http://img.shields.io/pypi/l/Django.svg - -

Build

diff --git a/server.js b/server.js index 85351eb..3786352 100644 --- a/server.js +++ b/server.js @@ -693,7 +693,7 @@ cache(function(data, match, sendBadge) { camp.route(/^\/pypi\/([^\/]+)\/(.*)\.(svg|png|gif|jpg)$/, cache(function(data, match, sendBadge) { var info = match[1]; - var egg = match[2]; // eg, `gevent`. + var egg = match[2]; // eg, `gevent`, `Django`. var format = match[3]; var apiUrl = 'https://pypi.python.org/pypi/' + egg + '/json'; var badgeData = getBadgeData('pypi', data); @@ -736,10 +736,9 @@ cache(function(data, match, sendBadge) { badgeData.text[0] = 'license'; if(license == null || license == 'UNKNOWN') { badgeData.text[1] = 'Unknown'; - badgeData.colorscheme = 'red'; } else { badgeData.text[1] = license; - badgeData.colorscheme = 'blue'; + badgeData.colorscheme = 'red'; } sendBadge(format, badgeData); } diff --git a/try.html b/try.html index 8f1f8f6..f271c9c 100644 --- a/try.html +++ b/try.html @@ -123,6 +123,10 @@ I made the GitHub Badge Service. + + + +
http://img.shields.io/npm/l/express.svg
PyPI: http://img.shields.io/pypi/l/Django.svg
CocoaPods: http://img.shields.io/cocoapods/l/AFNetworking.svg