From 25402284a789ee02467ca530d65fe39f0020bf88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Hu=C5=A1ek?= <husek@iuuk.mff.cuni.cz>
Date: Tue, 10 Oct 2017 21:12:20 +0200
Subject: [PATCH] define & use DIR constant

---
 cups-pdf-postprocess.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cups-pdf-postprocess.py b/cups-pdf-postprocess.py
index cc5dd1d..0ad636e 100755
--- a/cups-pdf-postprocess.py
+++ b/cups-pdf-postprocess.py
@@ -171,7 +171,7 @@ class CPP(QWidget):
       pipeline.append([ "pdfbook", "/dev/stdin", "-o", "/dev/stdout" ])
 
     if self._compact.isChecked():
-      pipeline.append([ "%s/%s" % (os.path.dirname(os.path.realpath(sys.argv[0])), "print_compact.sh"),
+      pipeline.append([ "%s/print_compact.sh" % DIR,
                         "%i" % self._compact_copies.value() ])
 
     if self._printer.currentData() is SAVE_AS_FILE:
@@ -190,6 +190,7 @@ class CPP(QWidget):
     exec_pipeline(pipeline, self._pdf, err_callback=logMsg)
     self._button_cancel.setText("Close")
 
+DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
 
 if __name__ == '__main__':
   app = QApplication(sys.argv[2:])
-- 
GitLab