restructured integration do_export

This commit is contained in:
Tiago Rascazzi
2022-01-03 12:46:34 -05:00
parent ba032e9353
commit 56ee5671ea
4 changed files with 55 additions and 51 deletions

View File

@ -23,7 +23,7 @@ class PDFexport(Integration):
async def gen_pdf(self, recipes, sessionid):
async def get_files_from_recipes_async(self, recipes, cookie):
cmd = runserver.Command()
browser = await launch(
@ -33,7 +33,7 @@ class PDFexport(Integration):
ignoreHTTPSErrors=True
)
cookies = {'domain': cmd.default_addr, 'name': 'sessionid', 'value': sessionid,}
cookies = {'domain': cmd.default_addr, 'name': 'sessionid', 'value': cookie['sessionid'],}
options = { 'format': 'letter',
'margin': {
'top': '0.75in',
@ -59,4 +59,4 @@ class PDFexport(Integration):
def get_files_from_recipes(self, recipes, cookie):
return asyncio.run(self.gen_pdf(recipes, cookie['sessionid']))
return asyncio.run(self.get_files_from_recipes_async(recipes, cookie))