Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
eta
gajim
Commits
a62328ec
Commit
a62328ec
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
remove duplicate function, simplify logic
parent
371a38c9
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
src/common/xmpp/debug.py
+1
-19
1 addition, 19 deletions
src/common/xmpp/debug.py
with
1 addition
and
19 deletions
src/common/xmpp/debug.py
+
1
−
19
View file @
a62328ec
...
...
@@ -283,25 +283,7 @@ class Debug:
s
=
s
+
c
self
.
_fh
.
write
(
'
%s%s%s
'
%
(
pre
,
s
,
suf
))
self
.
_fh
.
flush
()
def
is_active
(
self
,
flag
):
'
If given flag(s) should generate output.
'
# try to abort early to quicken code
if
not
self
.
active
:
return
0
if
not
flag
or
flag
in
self
.
active
:
return
1
else
:
# check for multi flag type:
if
type
(
flag
)
in
(
type
(()),
type
([])
):
for
s
in
flag
:
if
s
in
self
.
active
:
return
1
return
0
def
active_set
(
self
,
active_flags
=
None
):
"
returns 1 if any flags where actually set, otherwise 0.
"
r
=
0
...
...
@@ -411,7 +393,7 @@ class Debug:
def
is_active
(
self
,
flag
):
if
not
self
.
active
:
return
0
if
not
flag
or
flag
in
self
.
active
and
DBG_ALWAYS
not
in
self
.
active
or
flag
not
in
self
.
active
and
DBG_ALWAYS
in
self
.
active
:
return
1
if
not
flag
or
((
flag
in
self
.
active
)
^
(
DBG_ALWAYS
in
self
.
active
))
:
return
1
return
0
DBG_ALWAYS
=
'
always
'
...
...
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