Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
5acdef81
Commit
5acdef81
authored
Mar 05, 2015
by
bow
Browse files
Pass path to logo to template generator
parent
c55ab605
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/pdf_report.py
View file @
5acdef81
...
...
@@ -84,7 +84,7 @@ def natural_sort(inlist):
return
inlist
def
write_template
(
summary_file
,
template_file
):
def
write_template
(
summary_file
,
template_file
,
logo_file
):
template_file
=
path
.
abspath
(
path
.
realpath
(
template_file
))
template_dir
=
path
.
dirname
(
template_file
)
...
...
@@ -112,7 +112,7 @@ def write_template(summary_file, template_file):
render_vars
=
{
"gentrap"
:
{
"version"
:
"--testing--"
,
"logo"
:
"/home/warindrarto/devel/intellij/biopet/public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/templates/img/gentrap_front.png"
,
"logo"
:
logo_file
,
},
}
rendered
=
jinja_template
.
render
(
**
render_vars
)
...
...
@@ -127,6 +127,8 @@ if __name__ == "__main__":
help
=
"Path to Gentrap summary file"
)
parser
.
add_argument
(
"template_file"
,
type
=
str
,
help
=
"Path to main template file"
)
parser
.
add_argument
(
"logo_file"
,
type
=
str
,
help
=
"Path to main logo file"
)
args
=
parser
.
parse_args
()
write_template
(
args
.
summary_file
,
args
.
template_file
)
write_template
(
args
.
summary_file
,
args
.
template_file
,
args
.
logo_file
)
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/PdfReportTemplateWriter.scala
View file @
5acdef81
...
...
@@ -21,6 +21,7 @@ class PdfReportTemplateWriter(val root: Configurable) extends PythonCommandLineF
val
templateResDir
:
File
=
new
File
(
getClass
.
getResource
(
"/nl/lumc/sasc/biopet/pipelines/gentrap/templates/pdf"
).
toURI
)
val
templateWorkDir
:
File
=
new
File
(
".queue/tmp/nl/lumc/sasc/biopet/pipelines/gentrap/templates/pdf"
)
val
imgWorkDir
:
File
=
new
File
(
templateWorkDir
,
"img"
)
@Input
(
doc
=
"Input summary file"
,
required
=
true
)
var
summaryFile
:
File
=
null
...
...
@@ -28,6 +29,9 @@ class PdfReportTemplateWriter(val root: Configurable) extends PythonCommandLineF
@Input
(
doc
=
"Main report template"
,
required
=
true
)
// def since we hard-code the template
def
mainTemplateFile
:
File
=
new
File
(
templateWorkDir
,
"main.tex"
)
@Input
(
doc
=
"Main report logo"
,
required
=
true
)
// def since we hard-code the logo
def
logoFile
:
File
=
new
File
(
imgWorkDir
,
"gentrap_front.png"
)
@Output
(
doc
=
"Output file"
,
required
=
true
)
var
output
:
File
=
null
...
...
@@ -39,6 +43,7 @@ class PdfReportTemplateWriter(val root: Configurable) extends PythonCommandLineF
getPythonCommand
+
required
(
summaryFile
)
+
required
(
mainTemplateFile
)
+
required
(
logoFile
.
getAbsoluteFile
)
+
" > "
+
required
(
output
)
}
...
...
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