Skip to content

Commit

Permalink
fix: removed dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelm committed Jan 31, 2022
1 parent 4e96e82 commit 7360a7f
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions utilities/process_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,30 +103,6 @@ def write_elements(file, elements):
file.write(" return ()\n")


def write_attribute_comment(file, element):
"""Write an attribute comment with type and other info for the docs"""
if element["is_array"]:
comment_bits = [f"list[{element['type']}]:"]
else:
comment_bits = [f"{element['type']}:"]
if element["is_required"]:
comment_bits.append("*Required*")
else:
comment_bits.append("*Optional*")
comment_bits.append(element["xmlname"])
if element["is_array"]:
comment_bits.append(" *Array*")
if element["is_table"]:
comment_bits.append(" *Tabular*")
wrapper = TextWrapper(
width=90,
initial_indent=" #: ",
subsequent_indent=" #: ",
break_long_words=False,
)
file.write("\n".join(wrapper.wrap(" ".join(comment_bits))) + "\n")


def write_attribute(file, element):
param_str = "" if element["is_required"] else "default=None"
if element["is_array"]:
Expand All @@ -136,26 +112,12 @@ def write_attribute(file, element):
else:
mytype = '"' + element["type"] + '"'
outstr = " " * 4 + element["name"] + ": " + mytype + " = attr.ib(" + param_str + ")"
# if len(outstr) >= 95:
# wrapper = TextWrapper(
# width=90,
# replace_whitespace=False,
# initial_indent=" " * 8,
# subsequent_indent=" " * 8,
# break_long_words=False,
# )
# file.write(" " * 4 + element["name"] + ": " + mytype + " = attr.ib(\n")
# file.write("\n".join(wrapper.wrap(param_str)) + ",\n")
# file.write(" " * 4 + ")\n")
# else:
# file.write(outstr + "\n")
file.write(outstr + "\n")


def process_class_elements(file, elements):
count = 0
for element in elements.values():
# write_attribute_comment(file, element)
write_attribute(file, element)
count += 1
if count > 0:
Expand Down

0 comments on commit 7360a7f

Please sign in to comment.