summaryrefslogtreecommitdiff
path: root/libmat2/pdf.py
diff options
context:
space:
mode:
authorjvoisin2018-10-12 11:49:24 +0200
committerjvoisin2018-10-12 11:49:24 +0200
commitb832a5941458083dd6147efb652036552f95b786 (patch)
treee9a844f329b668a307772499740adbb1dc24e903 /libmat2/pdf.py
parent6ce88b8b7f3f10d70b2fb890ed4970e7282a43b5 (diff)
Refactor lightweight mode implementation
Diffstat (limited to 'libmat2/pdf.py')
-rw-r--r--libmat2/pdf.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmat2/pdf.py b/libmat2/pdf.py
index c8769aa..140b4f4 100644
--- a/libmat2/pdf.py
+++ b/libmat2/pdf.py
@@ -37,7 +37,12 @@ class PDFParser(abstract.AbstractParser):
37 except GLib.GError: # Invalid PDF 37 except GLib.GError: # Invalid PDF
38 raise ValueError 38 raise ValueError
39 39
40 def remove_all_lightweight(self): 40 def remove_all(self) -> bool:
41 if self.lightweight_cleaning is True:
42 return self.__remove_all_lightweight()
43 return self.__remove_all_thorough()
44
45 def __remove_all_lightweight(self) -> bool:
41 """ 46 """
42 Load the document into Poppler, render pages on a new PDFSurface. 47 Load the document into Poppler, render pages on a new PDFSurface.
43 """ 48 """
@@ -64,7 +69,7 @@ class PDFParser(abstract.AbstractParser):
64 69
65 return True 70 return True
66 71
67 def remove_all(self): 72 def __remove_all_thorough(self) -> bool:
68 """ 73 """
69 Load the document into Poppler, render pages on PNG, 74 Load the document into Poppler, render pages on PNG,
70 and shove those PNG into a new PDF. 75 and shove those PNG into a new PDF.