Commit 5acdef81 authored by bow's avatar bow
Browse files

Pass path to logo to template generator

parent c55ab605
......@@ -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)
......@@ -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)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment