Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-web
Commits
94a5ebaf
Commit
94a5ebaf
authored
9 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
Refactor - Improve checks + docstrings
parent
9296c523
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/web/ui/converters.py
+3
-3
3 additions, 3 deletions
swh/web/ui/converters.py
with
3 additions
and
3 deletions
swh/web/ui/converters.py
+
3
−
3
View file @
94a5ebaf
...
...
@@ -7,7 +7,7 @@ from swh.core import hashutil
def
from_origin
(
origin
):
"""
Convert from an
swh
origin to an origin dictionary.
"""
Convert from an
SWH
origin to an origin dictionary.
"""
new_origin
=
{}
...
...
@@ -23,7 +23,7 @@ def from_origin(origin):
def
from_release
(
release
):
"""
Convert from an
swh
release to a json serializable release dictionary.
"""
Convert from an
SWH
release to a json serializable release dictionary.
Args:
release: Dict with the following keys
...
...
@@ -47,7 +47,7 @@ def from_release(release):
"""
new_release
=
{}
for
key
,
value
in
release
.
items
():
if
key
==
'
id
'
or
key
==
'
revision
'
:
if
key
in
[
'
id
'
,
'
revision
'
]
:
new_release
[
key
]
=
hashutil
.
hash_to_hex
(
value
)
if
value
else
None
elif
key
==
'
comment
'
:
new_release
[
key
]
=
value
.
decode
(
'
utf-8
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment