[X2Go-Commits] python-x2go.git - brokerclient (branch) updated: 0.0.36.1-29-g6822c55

X2Go dev team git-admin at x2go.org
Tue Jan 7 16:20:08 CET 2014


The branch, brokerclient has been updated
       via  6822c55e028584df65c0f1f3510317feefa17db3 (commit)
      from  e3fab9a7017ce5aa4198b899cd990bc197b62556 (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 |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

The diff of changes is:
diff --git a/x2go/printactions.py b/x2go/printactions.py
index b90e8a5..085a6db 100644
--- a/x2go/printactions.py
+++ b/x2go/printactions.py
@@ -294,7 +294,7 @@ class X2goPrintActionPRINT(X2goPrintAction):
             _default_printer = win32print.GetDefaultPrinter()
             if self.printer:
                 _printer = self.printer
-                #win32print.SetDefaultPrinter(_printer)
+                win32print.SetDefaultPrinter(_printer)
             else:
                 _printer = _default_printer
             self.logger('printing incoming PDF file %s' % pdf_file, loglevel=log.loglevel_NOTICE)
@@ -302,19 +302,23 @@ class X2goPrintActionPRINT(X2goPrintAction):
             try:
                 _stdin = file('nul', 'r')
                 _shell = True
-                p = subprocess.Popen(['gsprint.exe', pdf_file, ],
+                _program_files = os.environ['ProgramFiles']
+                _gsprint_bin = os.normpath(os.path.join(_program_files, 'ghostgum', 'gsview', 'gsprint.exe',))
+                self.logger('Trying Ghostgum tool ,,gsprint.exe'' for printing first (full path: %s)' % _gsprint_bin, loglevel=log.loglevel_DEBUG)
+                p = subprocess.Popen([_gsprint_bin, pdf_file, ],
                                      stdin=_stdin,
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.STDOUT,
                                      shell=_shell,
                                     )
             except:
+                self.logger('Falling back to win32api printing...' loglevel=log.loglevel_DEBUG)
                 try:
                     win32api.ShellExecute (
                           0,
                           "print",
                           pdf_file,
-                          _printer,
+                          None,
                           ".",
                           0
                     )
@@ -326,7 +330,7 @@ class X2goPrintActionPRINT(X2goPrintAction):
                         self.logger('Encountered win32api.error: %s' % str(e), loglevel=log.loglevel_ERROR)
 
             if self.printer:
-                #win32print.SetDefaultPrinter(_default_printer)
+                win32print.SetDefaultPrinter(_default_printer)
                 pass
 
         else:


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