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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
Dexter Gaon-Shatford
gajim
Commits
bd6675d2
Commit
bd6675d2
authored
5 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Util: Fix pylint errors
parent
baac812e
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
gajim/gtk/util.py
+12
-9
12 additions, 9 deletions
gajim/gtk/util.py
with
12 additions
and
9 deletions
gajim/gtk/util.py
+
12
−
9
View file @
bd6675d2
...
...
@@ -139,7 +139,8 @@ def nick_matching(nick: str) -> bool:
# handle people who have not posted/mentioned us
other_nicks
=
[
n
for
n
in
nicks
if
nick_matching
(
n
)
and
n
not
in
potential_matches_set
n
for
n
in
nicks
if
nick_matching
(
n
)
and
n
not
in
potential_matches_set
]
other_nicks
.
sort
(
key
=
str
.
lower
)
log
.
debug
(
'
Other matches: %s
'
,
other_nicks
)
...
...
@@ -515,8 +516,8 @@ def get_hardware_key_codes(keyval):
def
ensure_not_destroyed
(
func
):
@wraps
(
func
)
def
func_wrapper
(
self
,
*
args
,
**
kwargs
):
if
self
.
_destroyed
:
return
if
self
.
_destroyed
:
# pylint: disable=protected-access
return
None
return
func
(
self
,
*
args
,
**
kwargs
)
return
func_wrapper
...
...
@@ -533,7 +534,7 @@ def format_mood(mood, text):
def
format_activity
(
activity
,
subactivity
,
text
):
if
activity
is
None
:
return
return
None
if
subactivity
in
ACTIVITIES
[
activity
]:
subactivity
=
ACTIVITIES
[
activity
][
subactivity
]
...
...
@@ -555,9 +556,9 @@ def get_activity_icon_name(activity, subactivity=None):
return
icon_name
def
format_tune
(
artist
,
length
,
rating
,
source
,
title
,
track
,
uri
):
def
format_tune
(
artist
,
_
length
,
_
rating
,
source
,
title
,
_
track
,
_
uri
):
if
artist
is
None
and
title
is
None
and
source
is
None
:
return
return
None
artist
=
GLib
.
markup_escape_text
(
artist
or
_
(
'
Unknown Artist
'
))
title
=
GLib
.
markup_escape_text
(
title
or
_
(
'
Unknown Title
'
))
source
=
GLib
.
markup_escape_text
(
source
or
_
(
'
Unknown Source
'
))
...
...
@@ -590,8 +591,8 @@ def format_fingerprint(fingerprint):
fplen
=
len
(
fingerprint
)
wordsize
=
fplen
//
8
buf
=
''
for
w
in
range
(
0
,
fplen
,
wordsize
):
buf
+=
'
{0}
'
.
format
(
fingerprint
[
w
:
w
+
wordsize
])
for
char
in
range
(
0
,
fplen
,
wordsize
):
buf
+=
'
{0}
'
.
format
(
fingerprint
[
char
:
char
+
wordsize
])
buf
=
textwrap
.
fill
(
buf
,
width
=
36
)
return
buf
.
rstrip
().
upper
()
...
...
@@ -602,6 +603,7 @@ def find_widget(name, container):
return
child
if
isinstance
(
child
,
Gtk
.
Box
):
return
find_widget
(
name
,
child
)
return
None
class
MultiLineLabel
(
Gtk
.
Label
):
...
...
@@ -623,7 +625,8 @@ def set_max_size(self, size):
self
.
_max_width
=
size
def
do_get_preferred_width
(
self
):
minimum_width
,
natural_width
=
Gtk
.
ComboBoxText
.
do_get_preferred_width
(
self
)
minimum_width
,
natural_width
=
Gtk
.
ComboBoxText
.
do_get_preferred_width
(
self
)
if
natural_width
>
self
.
_max_width
:
natural_width
=
self
.
_max_width
...
...
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