Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
ee462694
Verified
Commit
ee462694
authored
Aug 19, 2019
by
Baptiste Beauplat
Browse files
Utilize outcome and severity to pass on info to user in rfstemplate plugin
parent
cf4f505b
Changes
3
Hide whitespace changes
Inline
Side-by-side
debexpo/plugins/rfstemplate.py
View file @
ee462694
...
@@ -91,6 +91,9 @@ class RfsTemplatePlugin(BasePlugin):
...
@@ -91,6 +91,9 @@ class RfsTemplatePlugin(BasePlugin):
upstream_license
=
"[fill in]"
upstream_license
=
"[fill in]"
package_changelog
=
"[your most recent changelog entry]"
package_changelog
=
"[your most recent changelog entry]"
outcome
=
"RFS: license, author and changelog parsed"
severity
=
constants
.
PLUGIN_SEVERITY_INFO
package_changelog
=
self
.
changes
.
get
(
'Changes'
,
''
).
strip
()
package_changelog
=
self
.
changes
.
get
(
'Changes'
,
''
).
strip
()
if
len
(
package_changelog
.
split
(
'
\n
'
))
>
2
:
if
len
(
package_changelog
.
split
(
'
\n
'
))
>
2
:
...
@@ -100,8 +103,15 @@ class RfsTemplatePlugin(BasePlugin):
...
@@ -100,8 +103,15 @@ class RfsTemplatePlugin(BasePlugin):
if
'author'
in
copyright_info
:
if
'author'
in
copyright_info
:
upstream_author
=
copyright_info
[
'author'
]
upstream_author
=
copyright_info
[
'author'
]
else
:
outcome
=
"RFS: author info missing"
severity
=
constants
.
PLUGIN_SEVERITY_WARNING
if
'license'
in
copyright_info
:
if
'license'
in
copyright_info
:
upstream_license
=
copyright_info
[
'license'
]
upstream_license
=
copyright_info
[
'license'
]
else
:
outcome
=
"RFS: no dep5 license"
severity
=
constants
.
PLUGIN_SEVERITY_ERROR
data
=
{
data
=
{
'upstream-author'
:
upstream_author
,
'upstream-author'
:
upstream_author
,
...
@@ -109,8 +119,6 @@ class RfsTemplatePlugin(BasePlugin):
...
@@ -109,8 +119,6 @@ class RfsTemplatePlugin(BasePlugin):
'package-changelog'
:
package_changelog
,
'package-changelog'
:
package_changelog
,
}
}
outcome
=
"RFS template information"
severity
=
constants
.
PLUGIN_SEVERITY_INFO
self
.
passed
(
outcome
,
data
,
severity
)
self
.
passed
(
outcome
,
data
,
severity
)
...
...
debexpo/templates/plugins/rfstemplate/html.mako
0 → 100644
View file @
ee462694
<div class="qa-header">
${str(o.outcome)}
</div>
%if o.rich_data:
%if o.severity != 3:
<div class="qa-content">
%if o.severity == 2:
Upstream-Contact: was not found in d/copyright.<br/>
RFS will not autocomplete the Upstream author.
%else:
<dt>Author</dt>
<dd>${o.rich_data['upstream-author']}</dd>
%endif
<dt>License</dt>
<dd>${o.rich_data['upstream-license']}</dd>
<dt>Changelog</dt>
<dd><pre>${o.rich_data['package-changelog']}</pre></dd>
</dl>
</div>
%endif
%endif
debexpo/templates/plugins/rfstemplate/text.mako
0 → 100644
View file @
ee462694
%for field, contents in sorted(o.rich_data.items()):
${field}: ${contents}
%endfor
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment