Skip to content

Commit 342d5ec

Browse files
committed
Fix indent. Do not use len sequence to determine if a sequence is empty (len-as-condition).
1 parent 97da0be commit 342d5ec

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plotly/offline/offline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def _plot_html(figure_or_data, config, validate, default_width,
267267
optional_line2 +
268268
'</script>'
269269
'').format(
270-
id=plotdivid, script=script,
271-
height=height, width=width)
270+
id=plotdivid, script=script,
271+
height=height, width=width)
272272

273273
return plotly_html_div, plotdivid, width, height
274274

@@ -369,7 +369,7 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
369369
if image not in __IMAGE_FORMATS:
370370
raise ValueError('The image parameter must be one of the following'
371371
': {}'.format(__IMAGE_FORMATS)
372-
)
372+
)
373373
# if image is given, and is a valid format, we will download the image
374374
script = get_image_download_script('iplot').format(format=image,
375375
width=image_width,
@@ -493,7 +493,7 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
493493
if image not in __IMAGE_FORMATS:
494494
raise ValueError('The image parameter must be one of the '
495495
'following: {}'.format(__IMAGE_FORMATS)
496-
)
496+
)
497497
# if the check passes then download script is injected.
498498
# write the download script:
499499
script = get_image_download_script('plot')

plotly/widgets/graph_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _handle_registration(self, event_type, callback, remove):
121121
self._event_handlers[event_type].register_callback(callback,
122122
remove=remove)
123123
event_callbacks = self._event_handlers[event_type].callbacks
124-
if (len(event_callbacks) and event_type not in self._listener_set):
124+
if (event_callbacks and event_type not in self._listener_set):
125125
self._listener_set.add(event_type)
126126
message = {'task': 'listen', 'events': list(self._listener_set)}
127127
self._handle_outgoing_message(message)

0 commit comments

Comments
 (0)