Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
a1435c6d
Commit
a1435c6d
authored
12 years ago
by
Anael Beutot
Browse files
Options
Downloads
Patches
Plain Diff
Changed tag handling.
parent
cffa3cba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ccnode/node.py
+1
-1
1 addition, 1 deletion
ccnode/node.py
ccnode/tags.py
+8
-8
8 additions, 8 deletions
ccnode/tags.py
with
9 additions
and
9 deletions
ccnode/node.py
+
1
−
1
View file @
a1435c6d
...
...
@@ -36,7 +36,7 @@ class DefaultHandler(RpcHandler):
:param iterable tags: list of tags to return
:param iterable noresolve_tags: list of tags to not return
"""
return
get_tags
(
self
,
tags
,
noresolve_tags
)
return
get_tags
(
self
.
tags
,
tags
,
noresolve_tags
)
def
set_tag
(
self
,
tag
):
self
.
tags
[
tag
.
name
]
=
tag
...
...
This diff is collapsed.
Click to expand it.
ccnode/tags.py
+
8
−
8
View file @
a1435c6d
...
...
@@ -87,28 +87,28 @@ def tag_inspector(mod, parent=None):
return
tags
def
get_tags
(
obj
,
tags
,
noresolve_tags
):
def
get_tags
(
tags_dict
,
tags
=
None
,
noresolve_tags
=
None
):
"""
Helper to get tags.
:param
obj: object with a dict ``tags`` attribute
:param tags:
L
ist of tags to get (None mean all tags)
:param noresolve_tags:
L
ist of tags to exclude from result
:param
tags_dict: dict containing :class:`Tag` objects
:param tags:
l
ist of tags to get (None mean all tags)
:param noresolve_tags:
l
ist of tags to exclude from result
"""
logger
.
debug
(
'
Tags request: %s, %s
'
,
unicode
(
tags
),
unicode
(
noresolve_tags
))
tags
=
set
(
tags
)
-
set
(
noresolve_tags
)
if
tags
is
not
None
else
None
if
tags
is
None
:
tags
=
obj
.
tags
.
iterkeys
()
tags
=
tags
_dict
.
iterkeys
()
else
:
tags
=
tags
&
set
(
obj
.
tags
)
tags
=
tags
&
set
(
tags
_dict
)
profile
=
time
.
time
()
result
=
dict
((
t
,
# tag name
dict
(
value
=
obj
.
tags
[
t
].
value
,
ttl
=
obj
.
tags
[
t
].
ttl
,
value
=
tags
_dict
[
t
].
value
,
ttl
=
tags
_dict
[
t
].
ttl
,
),
)
for
t
in
tags
)
...
...
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