[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.0.38.0-67-g3a23cbf

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


The branch, build-baikal has been updated
       via  3a23cbfdeb5681d8cfa70a09f023c785a8434a7f (commit)
      from  7f51af9c7b7806ca28b6dbeb567d6c8595efd157 (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/backends/printing/_file.py |    6 ++++--
 x2go/client.py                  |    4 ++--
 x2go/printactions.py            |   15 ++++-----------
 3 files changed, 10 insertions(+), 15 deletions(-)

The diff of changes is:
diff --git a/x2go/backends/printing/_file.py b/x2go/backends/printing/_file.py
index d8e1b48..8134ae5 100644
--- a/x2go/backends/printing/_file.py
+++ b/x2go/backends/printing/_file.py
@@ -139,13 +139,15 @@ class X2goClientPrintingFILE(inifiles.X2goIniFile):
         """
         return self.get_print_action()
 
-    def get_print_action(self, reinit=False, return_name=False):
+    def get_print_action(self, reload=False, reinit=False, return_name=False):
         """\
         Return the print action described by the »printing« configuration file.
 
         """
-        if reinit:
+        if reload:
             self.load()
+
+        if reinit:
             self._detect_print_action()
 
         if return_name:
diff --git a/x2go/client.py b/x2go/client.py
index 73845eb..c517f3f 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -283,8 +283,8 @@ class X2goClient(object):
     # user hooks for detecting/notifying what happened during application runtime
     def HOOK_no_known_xserver_found(self):
         self.logger('the Python X2go module could not find any usable XServer application, you will not be able to start X2go sessions without XServer', loglevel=log.loglevel_WARN)
-    def HOOK_open_print_dialog(self, filename, profile_name='UNKNOWN', session_name='UNKNOWN'):
-        self.logger('HOOK_open_print_dialog: incoming print job ,, %s'' detected by X2goClient hook method' % filename, loglevel=log.loglevel_WARN)
+    def HOOK_open_print_dialog(self, profile_name='UNKNOWN', session_name='UNKNOWN'):
+        self.logger('HOOK_open_print_dialog: incoming print job detected by X2goClient hook method', loglevel=log.loglevel_WARN)
     def HOOK_no_such_command(self, cmd, profile_name='UNKNOWN', session_name='UNKNOWN'):
         self.logger('HOOK_no_such_command: the command %s is not available for X2go server (profile: %s, session: %s)' % (cmd, profile_name, session_name), loglevel=log.loglevel_WARN)
     def HOOK_open_dropbox_saveas_dialog(self, filename, profile_name='UNKNOWN', session_name='UNKNOWN'):
diff --git a/x2go/printactions.py b/x2go/printactions.py
index a6367b3..42b748b 100644
--- a/x2go/printactions.py
+++ b/x2go/printactions.py
@@ -478,15 +478,8 @@ class X2goPrintActionDIALOG(X2goPrintAction):
         @type spool_dir: C{str}
 
         """
-        _hr_filename = self._humanreadable_filename(pdf_file, job_title, spool_dir)
-        shutil.copy2(pdf_file, _hr_filename)
-        self.logger('Session %s (%s) is calling X2goClient class hook method <client_instance>.HOOK_open_print_dialog(%s)' % (self.session_name, self.profile_name, _hr_filename), loglevel=log.loglevel_NOTICE)
-        self.client_instance.HOOK_open_print_dialog(_hr_filename,profile_name=self.profile_name, session_name=self.session_name)
-
-        # this is nasty!!!!
-        self.logger('waiting 20s longer before deleting the PDF file ,,%s\'\'' % _hr_filename, loglevel=log.loglevel_DEBUG)
-        time.sleep(20)
-        try: os.remove(_hr_filename)
-        except OSError: pass
-
+        self.logger('Session %s (%s) is calling X2goClient class hook method <client_instance>.HOOK_open_print_dialog' % (self.session_name, self.profile_name), loglevel=log.loglevel_NOTICE)
+        _new_print_action, _new_print_action_properties = self.client_instance.HOOK_open_print_dialog(profile_name=self.profile_name, session_name=self.session_name)
+        if type(_new_print_action) != type(self):
+            _new_print_action.do_print(pdf_file, job_title, spool_dir)
 


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