Skip to content

Commit 743260b

Browse files
committed
Improve template
1 parent cbd4cb4 commit 743260b

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

debsources/app/copyright/templates/copyright/value_error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<h2>{{ self.title() }}</h2>
1212
<p>Parsing The debian/copyright file yields a Value error. The error is {{error}}
1313

14-
<a href="{{ url_for('sources.source', path_to=(package +'/'+version+'/debian/copyright'))}}">View raw copyright file</a>
14+
<p><a href="{{ url_for('sources.source', path_to=(package +'/'+version+'/debian/copyright'))}}">View raw copyright file</a></p>
1515
</p>
1616
{% endblock %}

debsources/app/copyright/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ def get_objects(self, path_to):
8080
version=version,
8181
dump='False',
8282
header=helper.get_copyright_header(c),
83-
files=helper.parse_copyright_paragraphs_for_html_render(
83+
files=helper.parse_copyright_paragraphs_html_render(
8484
c, "/src/" + package + "/" + version + "/"),
8585
licenses=helper.parse_licenses_for_html_render(c))
8686
except ValueError as e:
87-
raise CopyrightValueError(package, version, e)
87+
raise CopyrightValueError(package, version, str(e))
8888

8989

9090
class ChecksumLicenseView(ChecksumView):

debsources/license_helper.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def get_copyright_header(copyright):
149149
return copyright.header._RestrictedWrapper__data
150150

151151

152-
def parse_copyright_paragraphs_for_html_render(copyright, base_url):
152+
def parse_copyright_paragraphs_html_render(copyright, base_url):
153153
""" Returns list of File objects. If `base_url` is provided
154154
then it creates links to base_url+glob
155155
"""
@@ -179,13 +179,10 @@ def parse_licenses_for_html_render(copyright):
179179
"""
180180
licenses = []
181181
for par in copyright.all_license_paragraphs():
182-
try:
183-
licenses.append({'synopsis': par.license.synopsis,
184-
'link': match_license(par.license.synopsis),
185-
'text': par.license.text,
186-
'comment': par.comment})
187-
except ValueError:
188-
raise ValueError
182+
licenses.append({'synopsis': par.license.synopsis,
183+
'link': match_license(par.license.synopsis),
184+
'text': par.license.text,
185+
'comment': par.comment})
189186
return licenses
190187

191188

0 commit comments

Comments
 (0)