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

csv writer update

parent 7717b36e
......@@ -16,7 +16,9 @@ from modgen.utility.file_management import copy_file, move_file
# TODO: Export to SQL
class CsvWriter:
def __init__(self, filename, table_to_print=None, header_array=None, file_separator: str = ","):
def __init__(
self, filename: str, table_to_print=None, header_array=None, file_separator: str = ","
):
if header_array is None:
header_array = []
if table_to_print is None:
......@@ -47,9 +49,9 @@ class CsvWriter:
file.write(str(entry[columnIndex]) + "\n")
file.close()
def copy_csv(self, copy_destination: str = g.copyDestination):
copy_file(self.filename, copy_destination)
print("CSV file was copied to " + copy_destination)
def copy_csv(self, copy_destination: str = "."):
copy_file(self.filename, copy_destination)
print("CSV file was copied to " + copy_destination)
def move_csv(self, move_destination):
move_file(self.filename, move_destination)
......@@ -57,5 +59,3 @@ class CsvWriter:
print("CSV Writer: CSV file was moved to parser root directory")
else:
print("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