Provided a SORTED_SUPPORTED_LICENSES (but keep the old unsorted dict!)
[mediagoblin.git] / mediagoblin / tools / licenses.py
1 # GNU MediaGoblin -- federated, autonomous media hosting
2 # Copyright (C) 2011 MediaGoblin contributors. See AUTHORS.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 SORTED_SUPPORTED_LICENSES = [
18 ("",
19 {"name": "No license specified",
20 "abbreviation": "All rights reserved"}),
21 ("http://creativecommons.org/licenses/by/3.0/",
22 {"name": "Creative Commons Attribution Unported 3.0",
23 "abbreviation": "CC BY 3.0"}),
24 ("http://creativecommons.org/licenses/by-sa/3.0",
25 {"name": "Creative Commons Attribution-ShareAlike Unported 3.0",
26 "abbreviation": "CC BY-SA 3.0"}),
27 ("http://creativecommons.org/licenses/by-nd/3.0",
28 {"name": "Creative Commons Attribution-NoDerivs 3.0 Unported",
29 "abbreviation": "CC BY-ND 3.0"}),
30 ("http://creativecommons.org/licenses/by-nc/3.0",
31 {"name": "Creative Commons Attribution-NonCommercial Unported 3.0",
32 "abbreviation": "CC BY-NC 3.0"}),
33 ("http://creativecommons.org/licenses/by-nc-sa/3.0",
34 {"name": "Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported",
35 "abbreviation": "CC BY-NC-SA 3.0"}),
36 ("http://creativecommons.org/licenses/by-nc-nd/3.0",
37 {"name": "Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported",
38 "abbreviation": "CC BY-NC-ND 3.0"}),
39 ("http://creativecommons.org/publicdomain/zero/1.0/",
40 {"name": "Creative Commons CC0 1.0 Universal",
41 "abbreviation": "CC0 1.0"}),
42 ("http://creativecommons.org/publicdomain/mark/1.0/",
43 {"name": "Public Domain",
44 "abbreviation": "Public Domain"})]
45
46 SUPPORTED_LICENSES = dict(SORTED_SUPPORTED_LICENSES)
47
48
49 def licenses_as_choices():
50 license_list = []
51
52 for uri, data in SUPPORTED_LICENSES.items():
53 license_list.append((uri, data["abbreviation"]))
54
55 return license_list