From 581842e653f8d74068d00e48f71b7ba4c22fcd4f Mon Sep 17 00:00:00 2001 From: Benedikt Seeger <benedikt.seeger@ptb.de> Date: Mon, 29 Jan 2024 09:08:40 +0100 Subject: [PATCH] changed issueTemplate include --- main.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 4e8d658..e366070 100644 --- a/main.py +++ b/main.py @@ -16,6 +16,29 @@ from bokeh.events import ValueSubmit import numpy as np colors=Category10[10] VERSION = "0.1.0" + +issueTemplate="""There was an issue with the following unit conversion: + +| Which unit | User entered input | Parsed input | +| ---------- | ------------------ | ------------ | +| Left unit | {} | {} | +| Right unit | {} | {} | + +### Result/Expectation: + +| Calculation | Result | Expectation | Did match | +|-------------|--------|-------------|-----------| +| Base unit | {} | | [ ] | +| factor * left = right | {} | | [ ] | +| factor * right = left | {} | | [ ] | +| factor * left = base | {} | | [ ] | +| factor * base = left | {} | | [ ] | +| factor * right = base | {} | | [ ] | +| factor * base = right | {} | | [ ] | + +If there was an error with the calculation, please fill out the table above. Feel free to also add additional info here: + +*Free text comment*""" class dsiparserInput(): def __init__(self,defaultInput=""): @@ -222,8 +245,8 @@ class page(): def createIssueUrl(self): quantitiesToAdd=[self.dsiInput1.dsiInput.value,str(self.dsiInput1.dsiTree),self.dsiInput2.dsiInput.value,str(self.dsiInput2.dsiTree),str(self.dsiCompGraphGen.baseUnit),self.dsiCompGraphGen.scalfactorAB,self.dsiCompGraphGen.scalfactorBA,self.dsiCompGraphGen.scalfactorABase,self.dsiCompGraphGen.scalfactorBaseA,self.dsiCompGraphGen.scalfactorBBase,self.dsiCompGraphGen.scalfactorBaseB] - templateStr=open('./issue.md').read() - filledResult=templateStr.format(*quantitiesToAdd) + #issueTemplate=open('./issue.md').read() #TODO add file inculde instead of the str.... + filledResult=issueTemplate.format(*quantitiesToAdd) filledTitle = f'Unexpected comparison result: {self.dsiInput1.dsiInput.value} to {self.dsiInput2.dsiInput.value}' issueUrl = r'https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend/-/issues/new?' title = quote(filledTitle) -- GitLab