[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.0.36.1-14-g2841cbe

X2Go dev team git-admin at x2go.org
Wed Jan 8 15:25:57 CET 2014


The branch, build-baikal has been updated
       via  2841cbe0a9aa3abb316ee6d82f69a8b7fd691d83 (commit)
      from  00a7b3d435b12ba881ec352ac70fd7eaa3b80808 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 x2go/printactions.py |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/x2go/printactions.py b/x2go/printactions.py
index 77130b0..e101658 100644
--- a/x2go/printactions.py
+++ b/x2go/printactions.py
@@ -41,6 +41,7 @@ from defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS
 if _X2GOCLIENT_OS in ("Windows"):
     import subprocess
     import win32api
+    import win32print
 else:
     import gevent_subprocess as subprocess
 
@@ -290,18 +291,27 @@ class X2goPrintActionPRINT(X2goPrintAction):
         """
         _hr_filename = self._humanreadable_filename(pdf_file, job_title, spool_dir)
         if _X2GOCLIENT_OS == 'Windows':
+            if self.printer:
+                _printer = self.printer
+            else:
+                _printer = win32print.GetDefaultPrinter()
             self.logger('printing incoming PDF file %s' % pdf_file, loglevel=log.loglevel_NOTICE)
+            self.logger('printer name is %s' % _printer, loglevel=log.loglevel_DEBUG)
             win32api.ShellExecute (
                   0,
                   "print",
                   pdf_file,
-                  None,
-                  None,
-                  0,
+                  '/d:"%s"' % _printer,
+                  ".",
+                  0
             )
         else:
             _hr_filename = self._humanreadable_filename(pdf_file, job_title, spool_dir)
             self.logger('printing incoming PDF file %s' % _hr_filename, loglevel=log.loglevel_NOTICE)
+            if self.printer:
+                self.logger('printer name is %s' % self.printer, loglevel=log.loglevel_DEBUG)
+            else:
+                self.logger('using default CUPS printer', loglevel=log.loglevel_DEBUG)
             shutil.copy2(pdf_file, _hr_filename)
             if self.printer is None:
                 cmd_line = [ 'lpr',


hooks/post-receive
-- 
python-x2go.git (Python X2Go Client API)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-x2go.git" (Python X2Go Client API).




More information about the x2go-commits mailing list