Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Kajongg
Commits
d2ef59d6
Commit
d2ef59d6
authored
Apr 09, 2021
by
Wolfgang Rohdewald
Browse files
pylint: remove too broad exceptions. Let's see what happens
parent
f1fcb974
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/deferredutil.py
View file @
d2ef59d6
...
...
@@ -266,10 +266,7 @@ class DeferredBlock(StrMixin):
if
hasattr
(
result
,
'traceback'
):
traceBack
=
result
.
traceback
else
:
try
:
traceBack
=
result
.
getBriefTraceback
()
except
BaseException
as
exc
:
traceBack
=
'twisted cannot give us a traceback:{}'
.
format
(
exc
)
traceBack
=
result
.
getBriefTraceback
()
self
.
table
.
abort
(
msg
,
request
.
user
.
name
,
...
...
src/rulesetselector.py
View file @
d2ef59d6
...
...
@@ -282,40 +282,37 @@ class EditableRuleModel(RuleModel):
# pylint: disable=too-many-branches
if
not
index
.
isValid
():
return
False
try
:
dirty
=
False
column
=
index
.
column
()
item
=
index
.
internalPointer
()
ruleset
=
item
.
ruleset
()
content
=
item
.
rawContent
if
role
==
Qt
.
EditRole
:
if
isinstance
(
content
,
Ruleset
)
and
column
==
0
:
oldName
=
content
.
name
content
.
rename
(
english
(
value
))
dirty
=
oldName
!=
content
.
name
elif
isinstance
(
content
,
RuleBase
):
dirty
,
message
=
self
.
__setRuleData
(
column
,
content
,
value
)
if
message
:
Sorry
(
message
)
return
False
else
:
return
False
elif
role
==
Qt
.
CheckStateRole
:
if
isinstance
(
content
,
BoolRule
)
and
column
==
1
:
if
not
isinstance
(
ruleset
,
PredefinedRuleset
):
newValue
=
value
==
Qt
.
Checked
if
content
.
parameter
!=
newValue
:
dirty
=
True
content
.
parameter
=
newValue
else
:
dirty
=
False
column
=
index
.
column
()
item
=
index
.
internalPointer
()
ruleset
=
item
.
ruleset
()
content
=
item
.
rawContent
if
role
==
Qt
.
EditRole
:
if
isinstance
(
content
,
Ruleset
)
and
column
==
0
:
oldName
=
content
.
name
content
.
rename
(
english
(
value
))
dirty
=
oldName
!=
content
.
name
elif
isinstance
(
content
,
RuleBase
):
dirty
,
message
=
self
.
__setRuleData
(
column
,
content
,
value
)
if
message
:
Sorry
(
message
)
return
False
if
dirty
:
if
isinstance
(
content
,
RuleBase
):
ruleset
.
updateRule
(
content
)
self
.
dataChanged
.
emit
(
index
,
index
)
return
True
except
BaseException
:
return
False
else
:
return
False
elif
role
==
Qt
.
CheckStateRole
:
if
isinstance
(
content
,
BoolRule
)
and
column
==
1
:
if
not
isinstance
(
ruleset
,
PredefinedRuleset
):
newValue
=
value
==
Qt
.
Checked
if
content
.
parameter
!=
newValue
:
dirty
=
True
content
.
parameter
=
newValue
else
:
return
False
if
dirty
:
if
isinstance
(
content
,
RuleBase
):
ruleset
.
updateRule
(
content
)
self
.
dataChanged
.
emit
(
index
,
index
)
return
True
def
flags
(
self
,
index
):
# pylint: disable=no-self-use
"""tell the view what it can do with this item"""
...
...
src/sound.py
View file @
d2ef59d6
...
...
@@ -353,7 +353,7 @@ class Voice(StrMixin):
(
existingMd5sum
,
md5Name
,
self
.
__md5sum
))
try
:
open
(
md5Name
,
'w'
).
write
(
'%s
\n
'
%
self
.
__md5sum
)
except
BaseException
as
exception
:
except
OSError
as
exception
:
logException
(
'
\n
'
.
join
([
i18n
(
'cannot write <filename>%1</filename>: %2'
,
md5Name
,
...
...
@@ -396,7 +396,7 @@ class Voice(StrMixin):
if
len
(
line
)
==
self
.
md5sumLength
:
return
line
logWarning
(
'{} has wrong content: {}'
.
format
(
self
.
md5FileName
(),
line
))
except
BaseException
as
exc
:
except
OSError
as
exc
:
logWarning
(
'{} has wrong content: {}'
.
format
(
self
.
md5FileName
(),
exc
))
return
None
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment