[cc-commits] [git]cc.license: Python API for selecting licenses and retrieving metadata (branch i18noverhaul) updated. adc9279a0c84fd517326d12a2d550636decbe137

Gitosis User webmaster at creativecommons.org
Fri Jan 13 18:35:24 EST 2012


The branch, i18noverhaul has been updated
       via  adc9279a0c84fd517326d12a2d550636decbe137 (commit)
      from  f8b33404b6bdd8b92dfe18181884c5ad62ef1328 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit adc9279a0c84fd517326d12a2d550636decbe137
Author: Christopher Allan Webber <cwebber at dustycloud.org>
Date:   Fri Jan 13 17:30:37 2012 -0600

    Fall back to CSV for country-code mappings if we have such things in CC0 formatter

-----------------------------------------------------------------------

Summary of changes (followed by patch):
 cc/license/formatters/classes.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cc/license/formatters/classes.py b/cc/license/formatters/classes.py
index 19f214d..06655c3 100644
--- a/cc/license/formatters/classes.py
+++ b/cc/license/formatters/classes.py
@@ -269,8 +269,14 @@ class CC0HTMLFormatter(HTMLFormatter):
         work_jurisdiction = work_dict.get('work_jurisdiction')
         country_name = None
         if work_jurisdiction not in ('', '-', None, False):
-            country_name = gettext(
-                mappers.COUNTRY_MAP[work_jurisdiction.lower()])
+            if work_jurisdiction.lower() in mappers.COUNTRY_MAP:
+                country_name = gettext(
+                    mappers.COUNTRY_MAP[work_jurisdiction.lower()])
+            # Crappy fallback to this CSV.  We should homogenize these
+            # things...
+            elif work_jurisdiction.upper() in util.CODE_COUNTRY_MAP:
+                country_name = gettext(
+                    util.CODE_COUNTRY_MAP[work_jurisdiction.upper()])
 
         rendered_template = template.render(
             {"gettext": gettext,


hooks/post-receive
-- 
cc.license: Python API for selecting licenses and retrieving metadata


More information about the cc-commits mailing list