From ec92e4ef534a5a6ede230a19e060b4aef58a5fa9 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Sun, 2 Oct 2016 00:45:19 -0400 Subject: [PATCH] testdata_index: Add slide licenses --- _testdata/testdata_index.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/_testdata/testdata_index.py b/_testdata/testdata_index.py index 0f2416d..df1363c 100755 --- a/_testdata/testdata_index.py +++ b/_testdata/testdata_index.py @@ -3,6 +3,7 @@ # testdata_index - Check metadata and build indexes for openslide-testdata # # Copyright (c) 2013-2015 Carnegie Mellon University +# Copyright (c) 2016 Benjamin Gilbert # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2.1 of the GNU Lesser General Public License @@ -32,6 +33,7 @@ )) MANDATORY_FIELDS = frozenset(( 'description', + 'license', 'sha256', )) OPTIONAL_FIELDS = frozenset(( @@ -48,6 +50,10 @@ tr:nth-child(2n + 3) { background: #f4f4f4; } +th { + padding-left: 10px; + padding-right: 10px; +} td { padding-top: 0.5em; padding-bottom: 0.5em; @@ -73,9 +79,11 @@ Name Size Description + License Credit - {% macro row(icon, href, name, size='', description='', credit='') %} + {% macro row(icon, href, name, size='', description='', license='', + credit='') %} @@ -83,6 +91,20 @@ {{ size }} {{ description }} + + {% if license == 'distributable' %} + Free to use and distribute, with or without modification + {% elif license == 'CC0-1.0' %} + CC0 + {% elif license == 'CC0-1.0-with-OpenSeadragon' %} + 3-clause BSD + for bundled OpenSeadragon, + CC0 + otherwise + {% elif license != '' %} + Unknown + {% endif %} + {{ credit }} {% endmacro %} @@ -95,7 +117,7 @@ {% for name, info in (files or {}).items()|sort %} {{ row('fa-file-archive-o' if name.endswith('.zip') else 'fa-file-image-o', name, name, info.size|file_size_units, info.description, - info.credit) }} + info.license, info.credit) }} {% endfor %} {% for extra in extras %} {{ row('fa-file-code-o', extra.name, extra.name,