Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
jsonschema
Commits
a0ef5166e34c
Commit
01994460
authored
Apr 09, 2018
by
Denis Laxalde
Browse files
Drop useless lists in .join() calls in serialize_links()
parent
d1ab61e767d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_jsonschema/links.py
View file @
a0ef5166
...
...
@@ -30,11 +30,11 @@ def serialize_links(link_dict):
for
link
in
links
:
link
[
'rel'
]
=
rel
href
=
link
.
pop
(
'href'
)
params
=
'; '
.
join
(
[
'{}="{}"'
.
format
(
k
,
v
)
for
k
,
v
in
sorted
(
link
.
items
())
]
)
params
=
'; '
.
join
(
'{}="{}"'
.
format
(
k
,
v
)
for
k
,
v
in
sorted
(
link
.
items
()))
ldos
.
append
({
"href"
:
href
,
"params"
:
params
})
ldos
.
sort
(
key
=
lambda
ldo
:
(
ldo
[
"href"
],
ldo
[
"params"
]))
return
', '
.
join
(
[
'<{href}>; {params}'
.
format
(
**
ldo
)
for
ldo
in
ldos
]
)
return
', '
.
join
(
'<{href}>; {params}'
.
format
(
**
ldo
)
for
ldo
in
ldos
)
def
_split_unquotted
(
delimiter
,
string
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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