[X2go-Commits] python-x2go.git - master (branch) updated: 0.1.1.4-121-g8cfeead

X2Go dev team git-admin at x2go.org
Sun Mar 4 21:58:51 CET 2012


The branch, master has been updated
       via  8cfeeadf4e47660f6f4123915c91a326eade3256 (commit)
       via  f6eae3f1599dd39cd7fe4628b1d28e0f8d288def (commit)
      from  ed6cc9d89628e50501bda74af5926acd2f97f4d5 (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 -----------------------------------------------------------------
commit 8cfeeadf4e47660f6f4123915c91a326eade3256
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Mar 4 21:58:47 2012 +0100

    complete background printing feature

commit f6eae3f1599dd39cd7fe4628b1d28e0f8d288def
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Mar 4 21:57:49 2012 +0100

    Run MIME box actions in background (gevent.spawn).

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog       |    1 +
 x2go/mimeboxactions.py |   22 ++++++++++++++++++----
 x2go/printactions.py   |    5 +++--
 3 files changed, 22 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 4468f70..a9e01f8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,6 +35,7 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
     - Fix faking of WindowsError exception object in printactions.py and
       mimeboxactions.py.
     - Run print actions in background (gevent.spawn).
+    - Run MIME box actions in background (gevent.spawn).
   * Depend on python-xlib.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sat, 28 Sep 2012 01:44:21 +0100
diff --git a/x2go/mimeboxactions.py b/x2go/mimeboxactions.py
index 2e247c1..319369f 100644
--- a/x2go/mimeboxactions.py
+++ b/x2go/mimeboxactions.py
@@ -29,6 +29,7 @@ __NAME__ = 'x2gomimeboxactions-pylib'
 import os
 import copy
 import time
+import gevent
 
 from defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS
 if _X2GOCLIENT_OS in ("Windows"):
@@ -93,7 +94,7 @@ class X2goMIMEboxAction(object):
         """
         return self.__description__
 
-    def do_process(self, mimebox_file, mimebox_dir, ):
+    def _do_process(self, mimebox_file, mimebox_dir, ):
         """\
         Perform the defined MIME box action (doing nothing in L{X2goMIMEboxAction} parent class).
 
@@ -105,6 +106,19 @@ class X2goMIMEboxAction(object):
         """
         pass
 
+    def do_process(self, mimebox_file, mimebox_dir, ):
+        """\
+        Wrapper (using C{gevent.spawn()}) method for the actual processing of MIME
+        box actions.
+
+        @param mimebox_file: file name as placed in to the X2Go MIME box directory
+        @type mimebox_file: C{str}
+        @param mimebox_dir: location of the X2Go sessions's MIME box directory
+        @type mimebox_dir: C{str}
+
+        """
+        gevent.spawn(self._do_process, mimebox_file, mimebox_dir, )
+
 
 class X2goMIMEboxActionOPEN(X2goMIMEboxAction):
     """\
@@ -129,7 +143,7 @@ class X2goMIMEboxActionOPEN(X2goMIMEboxAction):
         self.client_instance = client_instance
         X2goMIMEboxAction.__init__(self, logger=logger, loglevel=loglevel)
 
-    def do_process(self, mimebox_file, mimebox_dir, ):
+    def _do_process(self, mimebox_file, mimebox_dir, ):
         """\
         Open an incoming MIME box file in the system's default application.
 
@@ -184,7 +198,7 @@ class X2goMIMEboxActionOPENWITH(X2goMIMEboxAction):
         self.client_instance = client_instance
         X2goMIMEboxAction.__init__(self, logger=logger, loglevel=loglevel)
 
-    def do_process(self, mimebox_file, mimebox_dir, ):
+    def _do_process(self, mimebox_file, mimebox_dir, ):
         """\
         Open an incoming MIME box file in the system's default application.
 
@@ -242,7 +256,7 @@ class X2goMIMEboxActionSAVEAS(X2goMIMEboxAction):
             raise x2go_exceptions.X2goMIMEboxActionException('the SAVEAS MIME box action needs to know the X2goClient instance (client=<instance>)')
         X2goMIMEboxAction.__init__(self, client_instance=client_instance, logger=logger, loglevel=loglevel)
 
-    def do_process(self, mimebox_file, mimebox_dir):
+    def _do_process(self, mimebox_file, mimebox_dir):
         """\
         Call an L{X2goClient} hook method (C{HOOK_open_mimebox_saveas_dialog}) that
         can handle the MIME box's SAVEAS action.
diff --git a/x2go/printactions.py b/x2go/printactions.py
index 8227284..6dcf0cb 100644
--- a/x2go/printactions.py
+++ b/x2go/printactions.py
@@ -33,6 +33,7 @@ import os
 import shutil
 import copy
 import time
+import gevent
 
 from defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS
 if _X2GOCLIENT_OS in ("Windows"):
@@ -490,7 +491,7 @@ class X2goPrintActionDIALOG(X2goPrintAction):
             raise x2go_exceptions.X2goPrintActionException('the DIALOG print action needs to know the X2goClient instance (client=<instance>)')
         X2goPrintAction.__init__(self, client_instance=client_instance, logger=logger, loglevel=loglevel)
 
-    def do_print(self, pdf_file, job_title, spool_dir):
+    def _do_print(self, pdf_file, job_title, spool_dir):
         """\
         Execute an external command that has been defined on construction 
         of this L{X2goPrintActionPRINTCMD} instance.
@@ -506,5 +507,5 @@ class X2goPrintActionDIALOG(X2goPrintAction):
         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 = 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)
+            _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