[cc-commits] [git]cc.license (branch master) updated. 15e49890a27c49d22365de8e62560092dc8a1011
git version control
webmaster at creativecommons.org
Thu Mar 4 16:38:07 EST 2010
The branch, master has been updated
via 15e49890a27c49d22365de8e62560092dc8a1011 (commit)
via 07e4317fb37d47ad00a0f9c99eb7cd6fb107c091 (commit)
from 054db57cc5c7a31eec3c8b65ce41a41c2b9c6765 (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 15e49890a27c49d22365de8e62560092dc8a1011
Merge: 07e4317fb37d47ad00a0f9c99eb7cd6fb107c091 054db57cc5c7a31eec3c8b65ce41a41c2b9c6765
Author: John Doig <jed at jedpad.(none)>
Date: Thu Mar 4 13:38:01 2010 -0800
Merge branch 'master' of git at code.creativecommons.org:cc.license
commit 07e4317fb37d47ad00a0f9c99eb7cd6fb107c091
Author: John Doig <jed at jedpad.(none)>
Date: Thu Mar 4 13:36:55 2010 -0800
Prettifying my previous commit and added documentation
-----------------------------------------------------------------------
Summary of changes (followed by patch):
cc/license/_lib/classes.py | 24 +++++++++++++++++-------
cc/license/_lib/functions.py | 2 +-
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/cc/license/_lib/classes.py b/cc/license/_lib/classes.py
index 903d020..70bf30f 100644
--- a/cc/license/_lib/classes.py
+++ b/cc/license/_lib/classes.py
@@ -292,10 +292,20 @@ class Question(object):
def answers(self, language='en'):
if language == '':
language = 'en' # why not?
- return [(locale_dict_fetch_with_fallbacks(self._enums[k][0],
- language),
- k,
- (self._enums[k][1] != {} and \
- locale_dict_fetch_with_fallbacks(self._enums[k][1],
- language) or None))
- for k in self._enums.keys()]
+
+ answers = []
+ for k in self._enums.keys():
+ label = locale_dict_fetch_with_fallbacks(self._enums[k][0],
+ language)
+ # is there a description for this enum?
+ if self._enums[k][1] != {}:
+ # create a tuple with a localized description
+ enum = ( label, k,
+ locale_dict_fetch_with_fallbacks(self._enums[k][1],
+ language) )
+ else:
+ enum = ( label, k, None)
+
+ answers.append(enum)
+
+ return answers
diff --git a/cc/license/_lib/functions.py b/cc/license/_lib/functions.py
index 62edbc2..0c699ad 100644
--- a/cc/license/_lib/functions.py
+++ b/cc/license/_lib/functions.py
@@ -208,7 +208,7 @@ def all_possible_answers(list_of_questions):
new_adl = []
for adict in adl:
for enum in q.answers():
- answer = enum[1]
+ answer = enum[1] # the answer value
aclone = adict.copy()
aclone[q.id] = answer
new_adl.append(aclone)
hooks/post-receive
--
cc.license
More information about the cc-commits
mailing list