Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
howto-cards
Commits
344f3d72
Verified
Commit
344f3d72
authored
Aug 24, 2021
by
Laurent Heirendt
✈
Browse files
add exception handling if whitelist does not exist
parent
0dd6d30e
Changes
1
Hide whitespace changes
Inline
Side-by-side
.ci/generateIndex.py
View file @
344f3d72
import
os
,
re
from
os
import
path
from
natsort
import
natsorted
from
pathlib
import
Path
def
line_prepender
(
filename
,
line
):
with
open
(
filename
,
'r+'
)
as
f
:
...
...
@@ -236,9 +237,10 @@ print("\n > New index generated and saved in " + indexFile)
# write link whitelist out
whiteListFile
=
".ci/whitelist.txt"
with
open
(
whiteListFile
,
'r'
)
as
file
:
for
line
in
file
:
whiteList
+=
line
if
Path
(
whiteListFile
).
exists
():
with
open
(
whiteListFile
,
'r'
)
as
file
:
for
line
in
file
:
whiteList
+=
line
with
open
(
whiteListFile
,
'w'
)
as
file
:
file
.
write
(
whiteList
)
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