Unverified Commit af383e7f authored by Robin Mueller's avatar Robin Mueller
Browse files

smaller tweaks

parent bf38f952
......@@ -27,13 +27,13 @@ class CsvWriter:
self.table_to_print = table_to_print
self.header_array = header_array
if self.header_array != 0:
self.columnNumbers = len(self.header_array)
self.column_numbers = len(self.header_array)
self.file_separator = file_separator
def write_to_csv(self):
file = open(self.filename, "w")
file.write("Index" + self.file_separator)
for index in range(self.columnNumbers):
for index in range(self.column_numbers):
# noinspection PyTypeChecker
if index < len(self.header_array)-1:
file.write(self.header_array[index] + self.file_separator)
......@@ -41,7 +41,7 @@ class CsvWriter:
file.write(self.header_array[index] + "\n")
for index, entry in self.table_to_print.items():
file.write(str(index) + self.file_separator)
for columnIndex in range(self.columnNumbers):
for columnIndex in range(self.column_numbers):
# noinspection PyTypeChecker
if columnIndex < len(self.header_array) - 1:
file.write(str(entry[columnIndex]) + self.file_separator)
......@@ -53,9 +53,9 @@ class CsvWriter:
copy_file(self.filename, copy_destination)
print("CSV file was copied to " + copy_destination)
def move_csv(self, move_destination):
def move_csv(self, move_destination: str):
move_file(self.filename, move_destination)
if move_destination == ".." or move_destination == "../":
print("CSV Writer: CSV file was moved to parser root directory")
else:
print("CSV Writer: CSV file was moved to " + move_destination)
print(f"CSV Writer: CSV file was moved to {move_destination}")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment