Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fact_pdf_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
fact_pdf_report
Commits
0b318f8a
Commit
0b318f8a
authored
Mar 10, 2021
by
Jörg Stucke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added chown for output file
parent
db80073b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
docker_entry.py
docker_entry.py
+12
-6
No files found.
docker_entry.py
View file @
0b318f8a
...
...
@@ -26,17 +26,23 @@ from tempfile import TemporaryDirectory
from
pdf_generator.generator
import
compile_pdf
,
create_templates
def
get_data
():
return
json
.
loads
(
Path
(
'/tmp'
,
'interface'
,
'data'
,
'analysis.json'
)
.
read_text
()),
json
.
loads
(
Path
(
'/tmp'
,
'interface'
,
'data'
,
'meta.json'
)
.
read_text
())
INPUT_DIR
=
Path
(
'/tmp/interface'
)
def
move_pdf_report
(
pdf_path
):
shutil
.
move
(
str
(
pdf_path
.
absolute
()),
str
(
Path
(
'/tmp'
,
'interface'
,
'pdf'
,
pdf_path
.
name
)))
def
_load_data
(
file_name
:
str
)
->
dict
:
return
json
.
loads
((
INPUT_DIR
/
'data'
/
file_name
)
.
read_text
())
def
move_pdf_report
(
pdf_path
:
Path
):
output_path
=
INPUT_DIR
/
'pdf'
/
pdf_path
.
name
shutil
.
move
(
pdf_path
,
output_path
)
file_stats
=
INPUT_DIR
.
lstat
()
shutil
.
chown
(
output_path
,
user
=
file_stats
.
st_uid
,
group
=
file_stats
.
st_gid
)
def
main
(
template_style
=
'default'
):
analysis
,
meta_data
=
get_data
()
analysis
=
_load_data
(
'analysis.json'
)
meta_data
=
_load_data
(
'meta.json'
)
with
TemporaryDirectory
()
as
tmp_dir
:
create_templates
(
analysis
,
meta_data
,
tmp_dir
,
template_style
)
...
...
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