Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
a6c16026
Commit
a6c16026
authored
Aug 17, 2012
by
Clément Schreiner
Browse files
Make bool_field property return False if no value is found in the dict.
parent
aec6c204
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/plugins/api.py
View file @
a6c16026
...
...
@@ -96,7 +96,7 @@ def test_result(cls):
def
bool_field
(
name
):
""" Property exposing a string ('true' or 'false') as a bool. """
def
fget
(
instance
):
return
True
if
instance
[
name
]
==
'true'
else
False
return
True
if
instance
.
get
(
name
,
'false'
)
==
'true'
else
False
def
fset
(
instance
,
value
):
if
not
isinstance
(
value
,
bool
):
...
...
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