The branch, master has been updated via 1f56909114c7056270586a3481d278c4faad4218 (commit) via ea7ea6507c14479933a643257d9496fa58727da9 (commit) from 5c9619b3f1a8c241a5ede97b644c2794e512113c (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 1f56909114c7056270586a3481d278c4faad4218 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sun Mar 18 21:34:49 2012 +0100 Fix X2Go printing, do not spawn a gevent process for printing. commit ea7ea6507c14479933a643257d9496fa58727da9 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Mar 17 19:15:36 2012 +0100 Add support for published applications with no category submenus. Fix default language in published applications menu tree. ----------------------------------------------------------------------- Summary of changes: debian/changelog | 3 +++ x2go/backends/control/_stdout.py | 15 ++++++++++++++- x2go/printactions.py | 4 ++-- x2go/session.py | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) The diff of changes is: diff --git a/debian/changelog b/debian/changelog index 9550438..2a5d24b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,9 @@ python-x2go (0.1.2.0-0~x2go1) UNRELEASED; urgency=low - Render and cache dictionary based published applications menu tree in Python X2Go. Cache the tree once rendered. - Fix availablity check of client-side folder sharing. + - Add support for published applications with no category submenus. Fix + default language in published applications menu tree. + - Fix X2Go printing, do not spawn a gevent process for printing. * Depend on python-xlib. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Sat, 28 Sep 2012 01:44:21 +0100 diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py index 4366f5f..fbf0844 100644 --- a/x2go/backends/control/_stdout.py +++ b/x2go/backends/control/_stdout.py @@ -34,6 +34,7 @@ import copy import string import random import re +import locale from gevent import socket @@ -596,7 +597,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): return True return False - def get_published_applications(self, lang='en', refresh=False, raw=False, very_raw=False): + def get_published_applications(self, lang=None, refresh=False, raw=False, very_raw=False, max_no_submenus=0): """\ Retrieve the menu tree of published applications from X2Go server. @@ -619,6 +620,10 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): @rtype: C{list} """ + if defaults.X2GOCLIENT_OS != 'Windows' and lang is None: + lang = locale.getdefaultlocale()[0] + elif lang is None: + lang = 'en' if 'X2GO_PUBLISHED_APPLICATIONS' in self._x2go_server_features: if self._published_applications_menu is {} or not self._published_applications_menu.has_key(lang) or raw or very_raw or refresh: @@ -654,6 +659,10 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): self.logger('published applications query for %s finished, returning raw output' % self.profile_name, loglevel=log.loglevel_NOTICE) return _menu + if max_no_submenus and len(_menu) > max_no_submenus: + _render_submenus = True + else: + _render_submenus = False # STAGE 3: create menu structure in a Python dictionary @@ -669,6 +678,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): 'System': [], 'Utilities': [], 'Other Applications': [], + 'NO_SUBMENUS': [], } } _empty_menus = _category_map[lang].keys() @@ -729,6 +739,9 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): if not _menu_entry_cat: _menu_entry_cat = 'Other Applications' + if not _render_submenus: + _menu_entry_cat = 'NO_SUBMENUS' + if _menu_entry_cat in _empty_menus: _empty_menus.remove(_menu_entry_cat) diff --git a/x2go/printactions.py b/x2go/printactions.py index 45504e9..793ceea 100644 --- a/x2go/printactions.py +++ b/x2go/printactions.py @@ -130,7 +130,7 @@ class X2goPrintAction(object): @type spool_dir: C{str} """ - gevent.spawn(self._do_print, pdf_file, job_title, spool_dir) + self._do_print(pdf_file, job_title, spool_dir) def _humanreadable_filename(self, pdf_file, job_title, target_path): """\ @@ -200,7 +200,7 @@ class X2goPrintActionPDFVIEW(X2goPrintAction): if _X2GOCLIENT_OS == "Windows": self.logger('viewing incoming job in PDF viewer with Python\'s os.startfile( command): %s' % pdf_file, loglevel=log.loglevel_DEBUG) try: - os.startfile(pdf_file) + gevent.spawn(os.startfile, pdf_file) except WindowsError, win_err: if self.client_instance: self.client_instance.HOOK_printaction_error(pdf_file, diff --git a/x2go/session.py b/x2go/session.py index 8a05bee..5644888 100644 --- a/x2go/session.py +++ b/x2go/session.py @@ -1225,7 +1225,7 @@ class X2goSession(object): return self.terminal_session.is_desktop_session() return False - def get_published_applications(self, lang='en', refresh=False, raw=False, very_raw=False): + def get_published_applications(self, lang=None, refresh=False, raw=False, very_raw=False, max_no_submenus=0): """\ Return a list of published menu items from the X2Go server for session type published applications. 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).