Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
40611e01
Commit
40611e01
authored
4 years ago
by
Wuttke, Joachim
Committed by
Wuttke, Joachim
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
update update-website
parent
9e7b52d3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devtools/code-tools/update-website.py
+12
-12
12 additions, 12 deletions
devtools/code-tools/update-website.py
with
12 additions
and
12 deletions
devtools/code-tools/update-website.py
+
12
−
12
View file @
40611e01
...
@@ -7,7 +7,7 @@ ctest -R PyExamples
...
@@ -7,7 +7,7 @@ ctest -R PyExamples
This will run all existing examples and generate intensity images for web site.
This will run all existing examples and generate intensity images for web site.
2) Run this script
2) Run this script
python update-examples.py <website-source-dir> <example
s
_root> <img-dir>
python update-examples.py <website-source-dir> <example_root> <img-dir>
"""
"""
import
argparse
,
datetime
,
filecmp
,
os
,
shutil
import
argparse
,
datetime
,
filecmp
,
os
,
shutil
...
@@ -113,14 +113,14 @@ def update_all_files_of_one_type(example_root, dest_dir, extension):
...
@@ -113,14 +113,14 @@ def update_all_files_of_one_type(example_root, dest_dir, extension):
log
(
f
'
unused:
{
src
}
'
)
log
(
f
'
unused:
{
src
}
'
)
def
update_website
(
website_
example_
root
,
ba_
example_root
,
ba_
img_dir
):
def
update_website
(
website_root
,
example_root
,
img_dir
):
"""
"""
Updates example scripts and images on website.
Updates example scripts and images on website.
"""
"""
# Start logging
# Start logging
website_
dirpath
=
os
.
path
.
expanduser
(
website_
example_
root
)
website_
root
=
os
.
path
.
expanduser
(
website_root
)
log_path
=
os
.
path
.
join
(
website_
dirpath
,
"
update.examples.log
"
)
log_path
=
os
.
path
.
join
(
website_
root
,
"
update.examples.log
"
)
global
flog
global
flog
flog
=
open
(
log_path
,
"
a
"
)
flog
=
open
(
log_path
,
"
a
"
)
print
(
f
'
Appending log to
{
log_path
}
'
)
print
(
f
'
Appending log to
{
log_path
}
'
)
...
@@ -128,23 +128,23 @@ def update_website(website_example_root, ba_example_root, ba_img_dir):
...
@@ -128,23 +128,23 @@ def update_website(website_example_root, ba_example_root, ba_img_dir):
# Update scripts
# Update scripts
update_all_files_of_one_type
(
update_all_files_of_one_type
(
ba_
example
s
_root
,
example_root
,
os
.
path
.
join
(
website_
dirpath
,
"
static/files/python
"
),
os
.
path
.
join
(
website_
root
,
"
static/files/python
"
),
'
.py
'
)
'
.py
'
)
# Update images
# Update images
update_all_files_of_one_type
(
update_all_files_of_one_type
(
ba_
img_dir
img_dir
,
os
.
path
.
join
(
website_
dirpath
,
"
static/files/simulated
"
),
os
.
path
.
join
(
website_
root
,
"
static/files/simulated
"
),
'
.png
'
)
'
.png
'
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
website_
example_
root
"
,
type
=
str
)
parser
.
add_argument
(
"
website_root
"
,
type
=
str
)
parser
.
add_argument
(
"
ba_
example_root
"
,
type
=
str
)
parser
.
add_argument
(
"
example_root
"
,
type
=
str
)
parser
.
add_argument
(
"
ba_
img_dir
"
,
type
=
str
)
parser
.
add_argument
(
"
img_dir
"
,
type
=
str
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
update_website
(
args
.
website_
example_
root
,
args
.
ba_
example_root
,
args
.
ba_
img_dir
)
update_website
(
args
.
website_root
,
args
.
example_root
,
args
.
img_dir
)
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