8000 Python 2.6 doens’t like ‘{}’.format. · mathn/plotly.py@79766af · GitHub
[go: up one dir, main page]

Skip to content

Commit 79766af

Browse files
committed
Python 2.6 doens’t like ‘{}’.format.
1 parent 042b9a9 commit 79766af

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def get_data(self, flatten=False):
183183
d = {}
184184
for i, e in enumerate(l):
185185
for k, v in e.items():
186-
key = "{}.{}".format(i, k)
186+
key = "{0}.{1}".format(i, k)
187187
d[key] = v
188188
return d
189189
else:
@@ -463,7 +463,7 @@ def get_data(self, flatten=False):
463463
sub_data = val.get_data(flatten=flatten)
464464
if flatten:
465465
for sub_key, sub_val in sub_data.items():
466-
key_string = "{}.{}".format(key, sub_key)
466+
key_string = "{0}.{1}".format(key, sub_key)
467467
d[key_string] = sub_val
468468
else:
469469
d[key] = sub_data
@@ -900,19 +900,19 @@ def get_data(self, flatten=False):
900900

901901
# we want to give the traces helpful names
902902
# however, we need to be sure they're unique too...
903-
trace_name = trace.pop('name', 'trace_{}'.format(i))
903+
trace_name = trace.pop('name', 'trace_{0}'.format(i))
904904
if trace_name in taken_names:
905905
j = 1
906-
new_trace_name = "{}_{}".format(trace_name, j)
906+
new_trace_name = "{0}_{1}".format(trace_name, j)
907907
while new_trace_name in taken_names:
908-
new_trace_name = "{}_{}".format(trace_name, j)
908+
new_trace_name = "{0}_{1}".format(trace_name, j)
909909
j += 1
910910
trace_name = new_trace_name
911911
taken_names.append(trace_name)
912912

913913
# finish up the dot-concatenation
914914
for k, v in trace.items():
915-
key = "{}.{}".format(trace_name, k)
915+
key = "{0}.{1}".format(trace_name, k)
916916
d[key] = v
917917
return d
918918
else:

0 commit comments

Comments
 (0)
0