kirienko / gourmet

Gourmet Recipe Manager
GNU General Public License v2.0
30 stars 14 forks source link

Print to PDF failing #358

Closed seanms closed 3 years ago

seanms commented 3 years ago

Steps to Reproduce

  1. Select a recipe.
  2. Print
  3. Select a network printer which accepts PDF.

Expected Behavior

Recipe prints.

Current Behavior

Attempt to print fails with:

Traceback (most recent call last): File "/app/lib/python3.8/site-packages/gourmet/plugins/import_export/pdf_plugin/print_plugin.py", line 188, in begin_print pe = pdf_exporter.PdfExporterMultiDoc(self.rd,self.recs,fn,pdf_args=self.args, AttributeError: 'PDFRecipePrinter' object has no attribute 'args'

Possible Solution

The following diff works around the problem:

@@ -185,7 +185,7 @@

     def begin_print (self, operation, context):
         fn = tempfile.mktemp()
-        pe = pdf_exporter.PdfExporterMultiDoc(self.rd,self.recs,fn,pdf_args=self.args,
+        pe = pdf_exporter.PdfExporterMultiDoc(self.rd,self.recs,fn,
                                               change_units=self.change_units, mult=self.mult)
         pe.connect('error',self.handle_error)
         pe.run()

Environment

cydanil commented 3 years ago

Thank you for reporting the issue and taking time to propose a fix!

It makes sense, and that's what I went for :+1: