Skip to content

Commit 5e5a5fb

Browse files
committed
flake8 fixes
1 parent 1d4b5aa commit 5e5a5fb

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

Diff for: dash/dash.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _validate_callback(self, output, inputs, state, events):
406406
arg.component_id,
407407
arg.component_property,
408408
arg.component_id,
409-
component.available_properties)\
409+
component.available_properties)
410410
.replace(' ', ''))
411411

412412
if (hasattr(arg, 'component_event') and
@@ -422,7 +422,7 @@ def _validate_callback(self, output, inputs, state, events):
422422
arg.component_id,
423423
arg.component_event,
424424
arg.component_id,
425-
component.available_events)\
425+
component.available_events)
426426
.replace(' ', ''))
427427

428428
if state and not events and not inputs:

Diff for: dash/dependencies.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ def __init__(self, component_id, component_property):
44
self.component_id = component_id
55
self.component_property = component_property
66

7+
78
# pylint: disable=old-style-class, too-few-public-methods
89
class Input:
910
def __init__(self, component_id, component_property):
1011
self.component_id = component_id
1112
self.component_property = component_property
1213

14+
1315
# pylint: disable=old-style-class, too-few-public-methods
1416
class State:
1517
def __init__(self, component_id, component_property):
1618
self.component_id = component_id
1719
self.component_property = component_property
1820

21+
1922
# pylint: disable=old-style-class, too-few-public-methods
2023
class Event:
2124
def __init__(self, component_id, component_event):

Diff for: dash/development/base_component.py

+21-16
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def __init__(self, **kwargs):
2424
for k, v in list(kwargs.items()):
2525
if k not in self._prop_names: # pylint: disable=no-member
2626
# TODO - What's the right exception here?
27+
# pylint: disable=no-member
2728
raise Exception(
2829
'Unexpected keyword argument `{}`'.format(k) +
2930
'\nAllowed arguments: {}'.format(
30-
', '.join(sorted(self._prop_names)) # pylint: disable=no-member
31+
', '.join(sorted(self._prop_names))
3132
)
3233
)
3334
setattr(self, k, v)
@@ -43,12 +44,13 @@ def to_plotly_json(self):
4344

4445
return as_json
4546

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
4849
def _get_set_or_delete(self, id, operation, new_item=None):
4950
_check_if_has_indexable_children(self)
5051

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
5254
if isinstance(self.children, Component):
5355
if getattr(self.children, 'id', None) is not None:
5456
# Woohoo! It's the item that we're looking for
@@ -182,7 +184,8 @@ def __len__(self):
182184
return length
183185

184186

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):
186189
# Dynamically generate classes to have nicely formatted docstrings,
187190
# keyword arguments, and repr
188191
# Insired by http://jameso.be/2013/08/06/namedtuple.html
@@ -234,28 +237,29 @@ def __repr__(self):
234237
repr(getattr(self, self._prop_names[0], None)) + ')')
235238
'''
236239

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(
240244
typename,
241245
filtered_props,
242246
parse_events(props),
243247
description
244248
)
245-
events = '[' + ', '.join(parse_events(props)) + ']' # pylint: disable=unused-variable
249+
events = '[' + ', '.join(parse_events(props)) + ']'
246250
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'
249253
else:
250-
default_argtext = '**kwargs' # pylint: disable=unused-variable
251-
argtext = '**kwargs' # pylint: disable=unused-variable
254+
default_argtext = '**kwargs'
255+
argtext = '**kwargs'
252256

253-
required_args = required_props(props) # pylint: disable=unused-variable
257+
required_args = required_props(props)
254258

255259
d = c.format(**locals())
256260

257261
scope = {'Component': Component}
258-
exec(d, scope) # pylint: disable=exec-used
262+
exec(d, scope)
259263
result = scope[typename]
260264
return result
261265

@@ -355,7 +359,8 @@ def js_to_py_type(type_object):
355359
])),
356360

357361
# 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(
359364
'of {}s'.format(js_to_py_type(type_object['value']))
360365
if js_to_py_type(type_object['value']) != ''
361366
else ''

0 commit comments

Comments
 (0)