Skip to content

Commit f224c17

Browse files
more changes for python 2.7 tests
1 parent 05a5a54 commit f224c17

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dash/development/_py_components_generation.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import OrderedDict
22
import copy
33
import os
4-
from textwrap import fill, indent
4+
from textwrap import fill
55

66
from dash.development.base_component import _explicitize_args
77
from dash.exceptions import NonExistentEventException
@@ -455,10 +455,10 @@ def create_prop_docstring(
455455
dict_part2 = "".join([desc_indent, "Or", dict_part2])
456456
dict_descr = "{} \n\n {}".format(dict_part1, dict_part2)
457457

458-
# ensures indent is correct
458+
# ensures indent is correct if there is a second nested dict
459459
current_indent = dict_descr.lstrip("\n").find("-")
460-
if current_indent == len(indent_spacing):
461-
dict_descr = indent(dict_descr, " ")
460+
if current_indent == len(indent_spacing) + 4:
461+
dict_descr = "".join(" " + line for line in dict_descr.splitlines(True))
462462

463463
return (
464464
"\n{indent_spacing}- {name} ({dict_or_list}; {is_required}){colon}"
@@ -552,7 +552,6 @@ def shape_or_exact():
552552

553553
def map_js_to_py_types_flow_types(type_object):
554554
"""Mapping from the Flow js types to the Python type."""
555-
556555
return dict(
557556
array=lambda: "list",
558557
boolean=lambda: "boolean",

0 commit comments

Comments
 (0)