Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ipaaca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ramin Yaghoubzadeh Torky
ipaaca
Commits
02185cb5
Commit
02185cb5
authored
10 years ago
by
Hendrik Buschmeier
Browse files
Options
Downloads
Patches
Plain Diff
ipaaca-python: added public method to remove a category interest from an InputBuffer.
parent
441cb233
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ipaacalib/python/src/ipaaca/buffer.py
+14
-0
14 additions, 0 deletions
ipaacalib/python/src/ipaaca/buffer.py
ipaacatools/scripts/ipaaca-iu-sniffer
+2
-2
2 additions, 2 deletions
ipaacatools/scripts/ipaaca-iu-sniffer
with
16 additions
and
2 deletions
ipaacalib/python/src/ipaaca/buffer.py
+
14
−
0
View file @
02185cb5
...
...
@@ -222,6 +222,13 @@ class InputBuffer(Buffer):
self
.
_category_interests
.
append
(
iu_category
)
LOGGER
.
info
(
"
Added listener in scope /ipaaca/channel/
"
+
str
(
self
.
_channel
)
+
"
/category/
"
+
iu_category
)
def
_remove_category_listener
(
self
,
iu_category
):
'''
Remove the listener for a specific category.
'''
if
iu_category
in
self
.
_listener_store
and
iu_category
in
self
.
_category_interests
:
del
self
.
_listener_store
[
iu_category
]
self
.
_category_interests
.
remove
(
iu_category
)
LOGGER
.
info
(
"
Removed listener in scope /ipaaca/channel/
"
+
str
(
self
.
_channel
)
+
"
/category/
"
+
iu_category
)
def
_handle_iu_events
(
self
,
event
):
'''
Dispatch incoming IU events.
...
...
@@ -301,6 +308,13 @@ class InputBuffer(Buffer):
else
:
self
.
_add_category_listener
(
category_interests
)
def
remove_category_interests
(
self
,
category_interests
):
if
hasattr
(
category_interests
,
'
__iter__
'
):
for
interest
in
category_interests
:
self
.
_remove_category_listener
(
interest
)
else
:
self
.
_remove_category_listener
(
category_interests
)
def
_request_remote_resend
(
self
,
iu
):
remote_server
=
self
.
_get_remote_server
(
iu
)
resend_request
=
ipaaca_pb2
.
IUResendRequest
()
...
...
This diff is collapsed.
Click to expand it.
ipaacatools/scripts/ipaaca-iu-sniffer
+
2
−
2
View file @
02185cb5
...
...
@@ -64,8 +64,8 @@ def pretty_printed_dict(d):
v
=
str
(
v
)
v2
=
v
if
len
(
v
)
<=
arguments
.
max_size
else
v
[:
arguments
.
max_size
]
+
'
<excess length omitted>
'
v2
.
replace
(
'
\\
'
,
'
\\\\
'
).
replace
(
'
\n
'
,
highlight_if_color
(
'
\\
n
'
))
s
+=
"
\t
'
%s
'
:
'
%s
'
,
"
%
(
highlight_if_color
(
unicode
(
k
),
'
1
'
),
unicode
(
v2
))
s
+=
'
\n
}
'
s
+=
"
\t
'
%s
'
:
'
%s
'
,
\n
"
%
(
highlight_if_color
(
unicode
(
k
),
'
1
'
),
unicode
(
v2
))
s
+=
'
}
'
return
s
def
pretty_printed_iu_event
(
iu
,
event_type
,
local
):
...
...
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