[X2Go-Commits] python-x2go.git - release/0.4.0.x (branch) updated: 0.1.1.4-119-ged6cc9d
X2Go dev team
git-admin at x2go.org
Tue Jan 7 16:17:40 CET 2014
The branch, release/0.4.0.x has been updated
via ed6cc9d89628e50501bda74af5926acd2f97f4d5 (commit)
from f374c3b6f09dc326fa5205bb1c0de09804dd621d (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:
debian/changelog | 1 +
x2go/printactions.py | 27 +++++++++++++++++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 4d55322..4468f70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,7 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low
- Draw all Xlib code into utils.py
- Fix faking of WindowsError exception object in printactions.py and
mimeboxactions.py.
+ - Run print 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/printactions.py b/x2go/printactions.py
index d7af7a5..8227284 100644
--- a/x2go/printactions.py
+++ b/x2go/printactions.py
@@ -101,8 +101,8 @@ class X2goPrintAction(object):
"""
return self.__description__
- def do_print(self, pdf_file, job_title, spool_dir, ):
- """\
+ def _do_print(self, pdf_file, job_title, spool_dir, ):
+ """
Perform the defined print action (doing nothing in L{X2goPrintAction} parent class).
@param pdf_file: PDF file name as placed in to the X2Go spool directory
@@ -115,6 +115,21 @@ class X2goPrintAction(object):
"""
pass
+ def do_print(self, pdf_file, job_title, spool_dir, ):
+ """\
+ Wrap around the actual print action (C{self._do_print}) with
+ gevent.spawn().
+
+ @param pdf_file: PDF file name as placed in to the X2Go spool directory
+ @type pdf_file: C{str}
+ @param job_title: human readable print job title
+ @type job_title: C{str}
+ @param spool_dir: location of the X2Go client's spool directory
+ @type spool_dir: C{str}
+
+ """
+ gevent.spawn(self._do_print, pdf_file, job_title, spool_dir)
+
def _humanreadable_filename(self, pdf_file, job_title, target_path):
"""\
Extract a human readable filename for the X2Go print job file.
@@ -168,7 +183,7 @@ class X2goPrintActionPDFVIEW(X2goPrintAction):
self.pdfview_cmd = pdfview_cmd
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, ):
"""\
Open an incoming X2Go print job (PDF file) in an external PDF viewer application.
@@ -250,7 +265,7 @@ class X2goPrintActionPDFSAVE(X2goPrintAction):
if not os.path.exists(self.save_to_folder):
os.makedirs(self.save_to_folder, mode=0755)
- def do_print(self, pdf_file, job_title, spool_dir):
+ def _do_print(self, pdf_file, job_title, spool_dir):
"""\
Save an incoming X2Go print job (PDF file) to a local folder.
@@ -291,7 +306,7 @@ class X2goPrintActionPRINT(X2goPrintAction):
self.printer = printer
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, ):
"""\
Actually really print an incoming X2Go print job (PDF file) to a local printer device.
@@ -419,7 +434,7 @@ class X2goPrintActionPRINTCMD(X2goPrintAction):
self.print_cmd = print_cmd
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.
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