[cc-commits] [SCM] License chooser & etc (branch master) updated. 86b627634836bf2529522a452adc05e735c295d7

git version control git at a7.creativecommons.org
Thu Feb 4 15:11:37 EST 2010


The branch, master has been updated
       via  86b627634836bf2529522a452adc05e735c295d7 (commit)
      from  3eb06e93b0740ff4953be1c3aa36af02793a002c (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 86b627634836bf2529522a452adc05e735c295d7
Author: Christopher Allan Webber <cwebber at dustycloud.org>
Date:   Thu Feb 4 14:14:13 2010 -0600

    Moved cc.engine.util.get_selector_jurisdictions into cc.license

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

Summary of changes (followed by patch):
 cc/engine/chooser/views.py |    3 ++-
 cc/engine/util.py          |   24 ------------------------
 2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/cc/engine/chooser/views.py b/cc/engine/chooser/views.py
index 0f5ea85..9b8e0a1 100644
--- a/cc/engine/chooser/views.py
+++ b/cc/engine/chooser/views.py
@@ -6,6 +6,7 @@ from StringIO import StringIO
 from webob import Response, exc
 
 from cc.engine import util
+from cc.license import util as license_util
 from cc.i18npkg import ccorg_i18n_setup
 import cc.license
 from cc.license.formatters.classes import HTMLFormatter, CC0HTMLFormatter
@@ -250,7 +251,7 @@ def chooser_view(request):
         'macros_templates/support.pt')
 
     available_jurisdiction_codes = [
-        j.code for j in util.get_selector_jurisdictions('standard')]
+        j.code for j in license_util.get_selector_jurisdictions('standard')]
     
     context = _base_context(request)
 
diff --git a/cc/engine/util.py b/cc/engine/util.py
index bb62760..fcf2ec8 100644
--- a/cc/engine/util.py
+++ b/cc/engine/util.py
@@ -16,8 +16,6 @@ from zope.i18n.interfaces import ITranslationDomain
 from zope.i18n.translationdomain import TranslationDomain
 from zope.i18n import translate
 
-import cc.license
-from cc.license import selectors
 from cc.license._lib import rdf_helper
 from cc.license.formatters.pagetemplate import CCLPageTemplateFile
 from cc.i18npkg import ccorg_i18n_setup
@@ -386,28 +384,6 @@ def get_language_jurisdiction_map():
     return LANGUAGE_JURISDICTION_MAPPING
 
 
-def get_selector_jurisdictions(selector_name='standard'):
-    """
-
-    """
-    selector = selectors.choose(selector_name)
-    qstring = "\n".join(
-        ["SELECT ?license",
-         "WHERE (?license cc:licenseClass <%s>)" % str(selector.uri),
-         "USING cc FOR <http://creativecommons.org/ns#>"])
-    query = RDF.Query(qstring, query_language="rdql")
-
-    # This is so stupid, but if we add a WHERE clause for
-    # jurisdictions in the query string it takes approximately 5
-    # million years.
-    licenses = [
-        cc.license.by_uri(str(result['license'].uri))
-        for result in query.execute(rdf_helper.ALL_MODEL)]
-    jurisdictions = set([license.jurisdiction for license in licenses])
-    jurisdictions = [juri for juri in jurisdictions if juri.launched]
-    return jurisdictions
-
-
 class UnsafeResource(Error): pass
 
 def safer_resource_filename(package, resource):


hooks/post-receive
-- 
License chooser & etc



More information about the cc-commits mailing list