Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-images
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
static pages
docker-images
Commits
47b62cb4
Verified
Commit
47b62cb4
authored
Dec 15, 2021
by
psy
Browse files
Options
Downloads
Patches
Plain Diff
ommit file extension in cli flag
parent
87593f7a
Branches
Branches containing commit
Tags
release/notes/4.5.1
Tags containing commit
1 merge request
!2
add templates
Pipeline
#9681
passed
Dec 15, 2021
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
directory-listing/create-index.py
+2
-2
2 additions, 2 deletions
directory-listing/create-index.py
with
2 additions
and
2 deletions
directory-listing/create-index.py
+
2
−
2
View file @
47b62cb4
...
@@ -14,7 +14,7 @@ def main(inputfolder, outputfolder, template, ignore_files):
...
@@ -14,7 +14,7 @@ def main(inputfolder, outputfolder, template, ignore_files):
jinjaenv
=
jinja2
.
Environment
(
autoescape
=
jinja2
.
select_autoescape
(),
loader
=
jinja2
.
FileSystemLoader
(
"
templates
"
))
jinjaenv
=
jinja2
.
Environment
(
autoescape
=
jinja2
.
select_autoescape
(),
loader
=
jinja2
.
FileSystemLoader
(
"
templates
"
))
jinjaenv
.
filters
[
"
timestamp_to_datetime
"
]
=
timestamp_to_datetime
jinjaenv
.
filters
[
"
timestamp_to_datetime
"
]
=
timestamp_to_datetime
template
=
jinjaenv
.
get_template
(
template
)
template
=
jinjaenv
.
get_template
(
f
"
{
template
}
.html.j2
"
)
for
path
,
dirs
,
files
in
os
.
walk
(
inputfolder
):
for
path
,
dirs
,
files
in
os
.
walk
(
inputfolder
):
dirs
.
sort
()
dirs
.
sort
()
...
@@ -33,7 +33,7 @@ if __name__ == '__main__':
...
@@ -33,7 +33,7 @@ if __name__ == '__main__':
parser
=
argparse
.
ArgumentParser
(
description
=
'
Create html directory index for given path.
'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'
Create html directory index for given path.
'
)
parser
.
add_argument
(
'
path
'
,
type
=
pathlib
.
Path
,
help
=
'
Path to create index from
'
)
parser
.
add_argument
(
'
path
'
,
type
=
pathlib
.
Path
,
help
=
'
Path to create index from
'
)
parser
.
add_argument
(
'
output_directory
'
,
type
=
pathlib
.
Path
,
help
=
'
Directory for generated html files
'
)
parser
.
add_argument
(
'
output_directory
'
,
type
=
pathlib
.
Path
,
help
=
'
Directory for generated html files
'
)
parser
.
add_argument
(
'
--template
'
,
help
=
'
Template to use
'
,
default
=
'
default
.html.j2
'
)
parser
.
add_argument
(
'
--template
'
,
help
=
'
Template to use
without file extension (.html.j2)
'
,
default
=
'
default
'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment