Provided a SORTED_SUPPORTED_LICENSES (but keep the old unsorted dict!)
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 21 Jan 2012 22:51:21 +0000 (16:51 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 21 Jan 2012 22:51:21 +0000 (16:51 -0600)
mediagoblin/tools/licenses.py

index cb137fa8d932147aa04d935c4cad9e705e06bfb4..44d8e494ed67601d46fed3e0e0b274cce1940cdd 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-SUPPORTED_LICENSES = {
-    "": {
-        "name": "No license specified",
-        "abbreviation": "All rights reserved"
-        },
-    "http://creativecommons.org/licenses/by/3.0/": {
-        "name": "Creative Commons Attribution Unported 3.0",
-        "abbreviation": "CC BY 3.0"
-        },
-    "http://creativecommons.org/licenses/by-sa/3.0": {
-        "name": "Creative Commons Attribution-ShareAlike Unported 3.0",
-        "abbreviation": "CC BY-SA 3.0"
-        },
-    "http://creativecommons.org/licenses/by-nd/3.0": {
-        "name": "Creative Commons Attribution-NoDerivs 3.0 Unported",
-        "abbreviation": "CC BY-ND 3.0"
-        },
-    "http://creativecommons.org/licenses/by-nc/3.0": {
-        "name": "Creative Commons Attribution-NonCommercial Unported 3.0",
-        "abbreviation": "CC BY-NC 3.0"
-        },
-    "http://creativecommons.org/licenses/by-nc-sa/3.0": {
-        "name": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported",
-        "abbreviation": "CC BY-NC-SA 3.0"
-        },
-    "http://creativecommons.org/licenses/by-nc-nd/3.0": {
-        "name": "Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported",
-        "abbreviation": "CC BY-NC-ND 3.0"
-        },
-    "http://creativecommons.org/publicdomain/zero/1.0/": {
-        "name": "Creative Commons CC0 1.0 Universal",
-        "abbreviation": "CC0 1.0"
-        },
-    "http://creativecommons.org/publicdomain/mark/1.0/": {
-        "name": "Public Domain",
-        "abbreviation": "Public Domain"
-        },
-}
+SORTED_SUPPORTED_LICENSES = [
+    ("",
+     {"name": "No license specified",
+      "abbreviation": "All rights reserved"}),
+    ("http://creativecommons.org/licenses/by/3.0/",
+     {"name": "Creative Commons Attribution Unported 3.0",
+      "abbreviation": "CC BY 3.0"}),
+    ("http://creativecommons.org/licenses/by-sa/3.0",
+     {"name": "Creative Commons Attribution-ShareAlike Unported 3.0",
+      "abbreviation": "CC BY-SA 3.0"}),
+    ("http://creativecommons.org/licenses/by-nd/3.0",
+     {"name": "Creative Commons Attribution-NoDerivs 3.0 Unported",
+      "abbreviation": "CC BY-ND 3.0"}),
+    ("http://creativecommons.org/licenses/by-nc/3.0",
+     {"name": "Creative Commons Attribution-NonCommercial Unported 3.0",
+      "abbreviation": "CC BY-NC 3.0"}),
+    ("http://creativecommons.org/licenses/by-nc-sa/3.0",
+     {"name": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported",
+      "abbreviation": "CC BY-NC-SA 3.0"}),
+    ("http://creativecommons.org/licenses/by-nc-nd/3.0",
+     {"name": "Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported",
+      "abbreviation": "CC BY-NC-ND 3.0"}),
+    ("http://creativecommons.org/publicdomain/zero/1.0/",
+     {"name": "Creative Commons CC0 1.0 Universal",
+      "abbreviation": "CC0 1.0"}),
+    ("http://creativecommons.org/publicdomain/mark/1.0/",
+     {"name": "Public Domain",
+      "abbreviation": "Public Domain"})]
+
+SUPPORTED_LICENSES = dict(SORTED_SUPPORTED_LICENSES)
+
 
 def licenses_as_choices():
     license_list = []