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
genotoul-bioinfo
jflow
Commits
e1bce912
Commit
e1bce912
authored
Oct 28, 2015
by
Jerome Mariette
Browse files
replace __nonzero__ by __bool__
parent
2d0df95c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jflow/parameter.py
View file @
e1bce912
...
...
@@ -542,8 +542,8 @@ class BoolParameter(int, AbstractParameter):
val
.
is_None
=
False
if
default
!=
None
else
True
for
attr
in
bool
.
__dict__
:
func
=
getattr
(
bool
,
attr
)
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__bool__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
nonzero
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
bool
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
setattr
(
BoolParameter
,
attr
,
none_decorator
(
func
))
return
val
...
...
@@ -591,8 +591,8 @@ class IntParameter(int, AbstractParameter):
val
.
is_None
=
False
if
default
!=
None
else
True
for
attr
in
int
.
__dict__
:
func
=
getattr
(
int
,
attr
)
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__int__"
,
"__bool__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
nonzero
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__int__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
bool
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
setattr
(
IntParameter
,
attr
,
none_decorator
(
func
))
return
val
...
...
@@ -641,7 +641,7 @@ class FloatParameter(float, AbstractParameter):
for
attr
in
float
.
__dict__
:
func
=
getattr
(
float
,
attr
)
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__float__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
nonzero
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
"__eq__"
,
"__ne__"
,
"__
bool
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
setattr
(
FloatParameter
,
attr
,
none_decorator
(
func
))
return
val
...
...
@@ -690,7 +690,7 @@ class StrParameter(str, AbstractParameter):
for
attr
in
str
.
__dict__
:
func
=
getattr
(
str
,
attr
)
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__str__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
nonzero
__"
,
"__repr__"
,
"__getnewargs__"
]:
"__eq__"
,
"__ne__"
,
"__
bool
__"
,
"__repr__"
,
"__getnewargs__"
]:
setattr
(
StrParameter
,
attr
,
none_decorator
(
func
))
return
val
...
...
@@ -745,7 +745,7 @@ class DateParameter(datetime.datetime, AbstractParameter):
for
attr
in
datetime
.
datetime
.
__dict__
:
func
=
getattr
(
datetime
.
datetime
,
attr
)
if
isinstance
(
func
,
collections
.
Callable
)
and
attr
not
in
[
"__new__"
,
"__init__"
,
"__getattribute__"
,
"__setattribute__"
,
"__eq__"
,
"__ne__"
,
"__
nonzero
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
"__eq__"
,
"__ne__"
,
"__
bool
__"
,
"__str__"
,
"__repr__"
,
"__getnewargs__"
]:
setattr
(
DateParameter
,
attr
,
none_decorator
(
func
))
return
val
...
...
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