Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
source
OBSW MOD GENERATOR CORE
Commits
bf38f952
Unverified
Commit
bf38f952
authored
May 17, 2021
by
Robin Mueller
Browse files
csv writer update
parent
7717b36e
Changes
1
Hide whitespace changes
Inline
Side-by-side
utility/csv_writer.py
View file @
bf38f952
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment