Skip to content

Commit 5370ad9

Browse files
committed
fix: reformatting the code for pre-commit
1 parent 9d313e5 commit 5370ad9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/pyconverter/xml2py/ast_tree.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222

2323
import logging
2424
import textwrap
25-
from num2words import num2words as num
2625
from typing import List
2726
import warnings
2827

2928
from lxml.etree import tostring
3029
from lxml.html import fromstring
30+
from num2words import num2words as num
3131
from pyconverter.xml2py.utils.utils import is_numeric, split_trail_alpha
3232
import regex as re
3333

@@ -142,9 +142,11 @@ def to_py_arg_name(name: str) -> str:
142142
if arg[1].isdigit():
143143
raise ValueError(f"The code needs to be expanded to handle numbers")
144144
elif arg[1:3] not in superlatif:
145-
arg = f"{num(arg[0])}{arg[1:]}"
145+
num_value = num(arg[0])
146+
arg = f"{num_value}{arg[1:]}"
146147
else:
147-
arg = f"{num(arg[0], to="ordinal")}{arg[3:]}"
148+
num_value = num(arg[0], to="ordinal")
149+
arg = f"{num_value}{arg[3:]}"
148150
print(arg)
149151

150152
if ("," in arg and "--" in arg) or arg == "–":
@@ -2854,11 +2856,11 @@ def py_source(self, custom_functions=None, indent=""):
28542856
if custom_functions is None or self.py_name not in custom_functions.py_names:
28552857

28562858
if len(self.arg_desc) > 0:
2857-
command = 'command = f"' + self.name
2859+
command = 'command = f"' + self.name
28582860
for arg in self.arg_desc:
2859-
command += ',{'
2861+
command += ",{"
28602862
command += arg.py_arg_name
2861-
command += '}'
2863+
command += "}"
28622864
command += '"\n'
28632865
# ",{" + "},{".join(self.arg_desc.py_arg_name) + '}"\n'
28642866
else:

0 commit comments

Comments
 (0)