@@ -24,10 +24,11 @@ def __init__(self, **kwargs):
24
24
for k , v in list (kwargs .items ()):
25
25
if k not in self ._prop_names : # pylint: disable=no-member
26
26
# TODO - What's the right exception here?
27
+ # pylint: disable=no-member
27
28
raise Exception (
28
29
'Unexpected keyword argument `{}`' .format (k ) +
29
30
'\n Allowed arguments: {}' .format (
30
- ', ' .join (sorted (self ._prop_names )) # pylint: disable=no-member
31
+ ', ' .join (sorted (self ._prop_names ))
31
32
)
32
33
)
33
34
setattr (self , k , v )
@@ -43,12 +44,13 @@ def to_plotly_json(self):
43
44
44
45
return as_json
45
46
46
-
47
- # pylint: disable=too-many-branches, too-many-return-statements, redefined-builtin, inconsistent-return-statements
47
+ # pylint: disable=too-many-branches, too-many-return-statements
48
+ # pylint: disable=redefined-builtin, inconsistent-return-statements
48
49
def _get_set_or_delete (self , id , operation , new_item = None ):
49
50
_check_if_has_indexable_children (self )
50
51
51
- # pylint: disable=access-member-before-definition, attribute-defined-outside-init
52
+ # pylint: disable=access-member-before-definition,
53
+ # pylint: disable=attribute-defined-outside-init
52
54
if isinstance (self .children , Component ):
53
55
if getattr (self .children , 'id' , None ) is not None :
54
56
# Woohoo! It's the item that we're looking for
@@ -182,7 +184,8 @@ def __len__(self):
182
184
return length
183
185
184
186
185
- def generate_class (typename , props , description , namespace ): # pylint: disable=unused-argument
187
+ # pylint: disable=unused-argument
188
+ def generate_class (typename , props , description , namespace ):
186
189
# Dynamically generate classes to have nicely formatted docstrings,
187
190
# keyword arguments, and repr
188
191
# Insired by http://jameso.be/2013/08/06/namedtuple.html
@@ -234,28 +237,29 @@ def __repr__(self):
234
237
repr(getattr(self, self._prop_names[0], None)) + ')')
235
238
'''
236
239
237
- filtered_props = reorder_props (filter_props (props )) # pylint: disable=unused-variable
238
- list_of_valid_keys = repr (list (filtered_props .keys ())) # pylint: disable=unused-variable
239
- docstring = create_docstring ( # pylint: disable=unused-variable
240
+ # pylint: disable=unused-variable
241
+ filtered_props = reorder_props (filter_props (props ))
242
+ list_of_valid_keys = repr (list (filtered_props .keys ()))
243
+ docstring = create_docstring (
240
244
typename ,
241
245
filtered_props ,
242
246
parse_events (props ),
243
247
description
244
248
)
245
- events = '[' + ', ' .join (parse_events (props )) + ']' # pylint: disable=unused-variable
249
+ events = '[' + ', ' .join (parse_events (props )) + ']'
246
250
if 'children' in props :
247
- default_argtext = 'children=None, **kwargs' # pylint: disable=unused-variable
248
- argtext = 'children=children, **kwargs' # pylint: disable=unused-variable
251
+ default_argtext = 'children=None, **kwargs'
252
+ argtext = 'children=children, **kwargs'
249
253
else :
250
- default_argtext = '**kwargs' # pylint: disable=unused-variable
251
- argtext = '**kwargs' # pylint: disable=unused-variable
254
+ default_argtext = '**kwargs'
255
+ argtext = '**kwargs'
252
256
253
- required_args = required_props (props ) # pylint: disable=unused-variable
257
+ required_args = required_props (props )
254
258
255
259
d = c .format (** locals ())
256
260
257
261
scope = {'Component' : Component }
258
- exec (d , scope ) # pylint: disable=exec-used
262
+ exec (d , scope )
259
263
result = scope [typename ]
260
264
return result
261
265
@@ -355,7 +359,8 @@ def js_to_py_type(type_object):
355
359
])),
356
360
357
361
# React's PropTypes.arrayOf
358
- 'arrayOf' : lambda : 'list' .format ( # pylint: disable=too-many-format-args
362
+ # pylint: disable=too-many-format-args
363
+ 'arrayOf' : lambda : 'list' .format (
359
364
'of {}s' .format (js_to_py_type (type_object ['value' ]))
360
365
if js_to_py_type (type_object ['value' ]) != ''
361
366
else ''
0 commit comments