Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dimitri Podborski
AutomationTools
Commits
b663d3a6
Commit
b663d3a6
authored
Jan 28, 2021
by
Dimitri Podborski
Browse files
small bugfixes
parent
9586a453
Changes
1
Show whitespace changes
Inline
Side-by-side
systems.py
View file @
b663d3a6
...
...
@@ -183,7 +183,7 @@ def create_output_doc(csv_path, gitlab_projects, input_docs, template_path):
def
parse_csv
(
csv_file
,
projects
,
docs
):
issues
=
[]
with
open
(
csv_file
,
'r'
,
encoding
=
'utf-8-sig'
)
as
f
:
sample
=
f
.
read
(
1024
)
sample
=
f
.
read
line
(
)
f
.
seek
(
0
)
dialect
=
csv
.
Sniffer
().
sniff
(
sample
)
# find out the delimeter type
has_header
=
csv
.
Sniffer
().
has_header
(
sample
)
...
...
@@ -210,13 +210,16 @@ def parse_csv(csv_file, projects, docs):
sys
.
exit
(
-
1
)
for
row
in
reader
:
# skip empty lines
if
len
(
' '
.
join
(
row
).
strip
())
==
0
:
continue
project_url_or_path
=
None
# try URL first
if
project_url_idx
is
not
None
:
if
len
(
row
[
project_url_idx
])
>
0
:
project_url_or_path
=
row
[
project_url_idx
]
# If URL failed, try subgroup/projectname
if
project_url_or_path
is
None
:
if
project_url_or_path
is
None
and
subgroup_idx
is
not
None
and
project_name_idx
is
not
None
:
if
len
(
row
[
subgroup_idx
])
>
0
and
len
(
row
[
project_name_idx
])
>
0
:
project_url_or_path
=
row
[
subgroup_idx
]
+
'/'
+
row
[
project_name_idx
]
project
=
helpers
.
find_project
(
projects
,
project_url_or_path
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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