8000 pep8 updates · mode/plotly.py@2dd7c11 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2dd7c11

Browse files
committed
pep8 updates
1 parent 8e081e4 commit 2dd7c11

File tree

3 files changed

+27
-37
lines changed

3 files changed

+27
-37
lines changed

plotly/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,15 @@
3030

3131
from plotly import (plotly, graph_objs, grid_objs, tools, utils, session,
3232
offline)
33-
from plotly.version import __version__
3433
from plotly.check_version import get_latest
34+
from plotly.version import __version__
3535

3636
_latest = get_latest()
3737

38-
if __version__ != _latest :
39-
print("Your version of Plotly is currently outdated,\n" +
40-
"You're currently running {old}".format(old=__version__) +
41-
", while the latest version is {}".format(_latest))
38+
if __version__ != _latest:
39+
print("Your version of Plotly is currently outdated,\n" +
40+
"You're currently running {old}".format(old=__version__) +
41+
", while the latest version is {}".format(_latest))
4242
else:
43-
print("Plotly is currently up to date.\n" +
44-
"Plotly version: {}".format(__version__))
45-
43+
print("Plotly is currently up to date.\n" +
44+
"Plotly version: {}".format(__version__))

plotly/check_version.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
import os
22
import re
33

4-
def get_latest():
5-
os.system('pip show plotly > pip_version.txt')
6-
with open('pip_version.txt', 'r') as file:
7-
output = [i for i in file][2]
8-
latest_version = re.findall(r'\s.*\n', output)[0][1:-1]
9-
return latest_version
10-
11-
def run_duration(f, **kwargs):
12-
import timeit
13-
start_time = timeit.default_timer()
14-
f(**kwargs)
15-
return (timeit.default_timer() - start_time)
16-
17-
18-
19-
204

5+
def get_latest():
6+
os.system('pip show plotly > pip_version.txt')
7+
with open('pip_version.txt', 'r') as file:
8+
output = [i for i in file][2]
9+
latest_version = re.findall(r'\s.*\n', output)[0][1:-1]
10+
return latest_version
2111

2212

13+
def run_duration(f, **kwargs):
14+
import timeit
15+
start_time = timeit.default_timer()
16+
f(**kwargs)
17+
return (timeit.default_timer() - start_time)

plotly/check_version_sp.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import subprocess
22

3-
def get_latest():
4-
latest_version = subprocess.check_output(['pip', 'show', 'plotly']).split('\n')[2][9:]
5-
return latest_version
6-
7-
def run_duration(f, **kwargs):
8-
import timeit
9-
start_time = timeit.default_timer()
10-
f(**kwargs)
11-
return (timeit.default_timer() - start_time)
12-
13-
14-
15-
163

4+
def get_latest():
5+
latest_version = subprocess.check_output(
6+
['pip', 'show', 'plotly']).split('\n')[2][9:]
7+
return latest_version
178

189

10+
def run_duration(f, **kwargs):
11+
import timeit
12+
start_time = timeit.default_timer()
13+
f(**kwargs)
14+
return (timeit.default_timer() - start_time)

0 commit comments

Comments
 (0)
0