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

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


The branch, build-baikal has been updated
       via  e3fab9a7017ce5aa4198b899cd990bc197b62556 (commit)
      from  cd85ebe4f8c760e2497b4e9a3a0704f5eafda455 (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 |   38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

The diff of changes is:
diff --git a/x2go/printactions.py b/x2go/printactions.py
index 3a09c15..b90e8a5 100644
--- a/x2go/printactions.py
+++ b/x2go/printactions.py
@@ -300,20 +300,30 @@ class X2goPrintActionPRINT(X2goPrintAction):
             self.logger('printing incoming PDF file %s' % pdf_file, loglevel=log.loglevel_NOTICE)
             self.logger('printer name is ,,%s\'\'' % _printer, loglevel=log.loglevel_DEBUG)
             try:
-                win32api.ShellExecute (
-                      0,
-                      "printto",
-                      pdf_file,
-                      _printer,
-                      ".",
-                      0
-                )
-                time.sleep(20)
-            except win32api.error, e:
-                if self.client_instance:
-                    self.client_instance.HOOK_printaction_error(filename=_hr_filename, printer=_printer, err_msg=e.message, profile_name=self.profile_name, session_name=self.session_name)
-                else:
-                    self.logger('Encountered win32api.error: %s' % str(e), loglevel=log.loglevel_ERROR)
+                _stdin = file('nul', 'r')
+                _shell = True
+                p = subprocess.Popen(['gsprint.exe', pdf_file, ],
+                                     stdin=_stdin,
+                                     stdout=subprocess.PIPE,
+                                     stderr=subprocess.STDOUT,
+                                     shell=_shell,
+                                    )
+            except:
+                try:
+                    win32api.ShellExecute (
+                          0,
+                          "print",
+                          pdf_file,
+                          _printer,
+                          ".",
+                          0
+                    )
+                    time.sleep(20)
+                except win32api.error, e:
+                    if self.client_instance:
+                        self.client_instance.HOOK_printaction_error(filename=_hr_filename, printer=_printer, err_msg=e.message, profile_name=self.profile_name, session_name=self.session_name)
+                    else:
+                        self.logger('Encountered win32api.error: %s' % str(e), loglevel=log.loglevel_ERROR)
 
             if self.printer:
                 #win32print.SetDefaultPrinter(_default_printer)


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