|
|
@ -14,7 +14,15 @@ def convert_generic_v1(data):
|
|
|
|
|
|
|
|
|
|
|
|
def convert_usecase_v1(filename, data):
|
|
|
|
def convert_usecase_v1(filename, data):
|
|
|
|
split_raw_lines_from_file = [i.split(" | ") for i in data.split("\n") if i]
|
|
|
|
split_raw_lines_from_file = [i.split(" | ") for i in data.split("\n") if i]
|
|
|
|
split_raw_lines = [["ID", filename.upper()]] + split_raw_lines_from_file
|
|
|
|
|
|
|
|
|
|
|
|
if '/' in filename:
|
|
|
|
|
|
|
|
use_case_name = filename.rsplit("/", 1)[1].upper()
|
|
|
|
|
|
|
|
elif '\\' in filename:
|
|
|
|
|
|
|
|
use_case_name = filename.rsplit("\\", 1)[1].upper()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
use_case_name = filename.upper()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
split_raw_lines = [["ID", use_case_name]] + split_raw_lines_from_file
|
|
|
|
|
|
|
|
|
|
|
|
merged_lines = []
|
|
|
|
merged_lines = []
|
|
|
|
for i in split_raw_lines:
|
|
|
|
for i in split_raw_lines:
|
|
|
@ -96,7 +104,7 @@ if __name__=="__main__":
|
|
|
|
|
|
|
|
|
|
|
|
if len(files) == 1:
|
|
|
|
if len(files) == 1:
|
|
|
|
name = files[0]
|
|
|
|
name = files[0]
|
|
|
|
data = open(name).read()
|
|
|
|
data = open(name, encoding = "utf-8").read()
|
|
|
|
|
|
|
|
|
|
|
|
if usecase_formatting == YES:
|
|
|
|
if usecase_formatting == YES:
|
|
|
|
if verbose == YES:
|
|
|
|
if verbose == YES:
|
|
|
@ -113,14 +121,14 @@ if __name__=="__main__":
|
|
|
|
print(formatted_table_data)
|
|
|
|
print(formatted_table_data)
|
|
|
|
|
|
|
|
|
|
|
|
if write_to_file > AUTO:
|
|
|
|
if write_to_file > AUTO:
|
|
|
|
open(name + ".table", 'w').write(data+"\n")
|
|
|
|
open(name + ".table", 'w', encoding = "utf-8").write(data+"\n")
|
|
|
|
|
|
|
|
|
|
|
|
exit(0)
|
|
|
|
exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
for no, name in enumerate(sys.argv[1:]):
|
|
|
|
for no, name in enumerate(sys.argv[1:]):
|
|
|
|
print(f"Converting {no+1}/{len(sys.argv)}")
|
|
|
|
print(f"Converting {no+1}/{len(sys.argv)}")
|
|
|
|
|
|
|
|
|
|
|
|
data = open(name).read()
|
|
|
|
data = open(name, encoding = "utf-8").read()
|
|
|
|
|
|
|
|
|
|
|
|
if usecase_formatting == YES:
|
|
|
|
if usecase_formatting == YES:
|
|
|
|
if verbose >= AUTO:
|
|
|
|
if verbose >= AUTO:
|
|
|
@ -137,4 +145,4 @@ if __name__=="__main__":
|
|
|
|
print(formatted_table_data)
|
|
|
|
print(formatted_table_data)
|
|
|
|
|
|
|
|
|
|
|
|
if write_to_file >= AUTO:
|
|
|
|
if write_to_file >= AUTO:
|
|
|
|
open(name + ".table", 'w').write(data+"\n")
|
|
|
|
open(name + ".table", 'w', encoding = "utf-8").write(data+"\n")
|
|
|
|