The branch, twofactorauth has been updated via 926ebbbc9976ec45e3131f4dd814340ce9895933 (commit) from 3e9bd013e07df85ae426e58bc3c177cbb4f61977 (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/control/_stdout.py | 11 +++++++++++ x2go/backends/proxy/_nx3.py | 6 ++---- x2go/backends/proxy/base.py | 6 +++++- x2go/backends/terminal/_stdout.py | 27 +++++++++++++++++---------- x2go/client.py | 12 ++++++++++++ x2go/defaults.py | 1 + x2go/mime_export.py | 2 -- x2go/printactions.py | 2 -- x2go/printqueue.py | 2 -- x2go/registry.py | 12 ++++++++++++ x2go/session.py | 15 +++++++++++++++ 11 files changed, 75 insertions(+), 21 deletions(-) The diff of changes is: diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py index f3a3030..f0a06de 100644 --- a/x2go/backends/control/_stdout.py +++ b/x2go/backends/control/_stdout.py @@ -26,6 +26,7 @@ This backend handles X2go server implementations that respond via server-side ST __NAME__ = 'x2gocontrolsession-pylib' # modules +import os import types import paramiko import gevent @@ -78,6 +79,9 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): info_backend=_X2goServerSessionInfo, list_backend=_X2goServerSessionList, proxy_backend=_X2goProxy, + client_rootdir=os.path.join(defaults.LOCAL_HOME, defaults.X2GO_CLIENT_ROOTDIR), + session_rootdir=os.path.join(defaults.LOCAL_HOME, defaults.X2GO_SESSION_ROOTDIR), + ssh_rootdir=os.path.join(defaults.LOCAL_HOME, defaults.X2GO_SSH_ROOTDIR), logger=None, loglevel=log.loglevel_DEFAULT, *args, **kwargs): """\ @@ -105,6 +109,11 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): self._info_backend = info_backend self._list_backend = list_backend self._proxy_backend = proxy_backend + + self.client_rootdir = client_rootdir + self.session_rootdir = session_rootdir + self.ssh_rootdir = ssh_rootdir + paramiko.SSHClient.__init__(self, *args, **kwargs) def __del__(self): @@ -368,6 +377,8 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient): info_backend=self._info_backend, list_backend=self._list_backend, proxy_backend=self._proxy_backend, + client_rootdir=self.client_rootdir, + session_rootdir=self.session_rootdir, **kwargs) if session_name is not None: diff --git a/x2go/backends/proxy/_nx3.py b/x2go/backends/proxy/_nx3.py index 01eee7d..f229c3e 100644 --- a/x2go/backends/proxy/_nx3.py +++ b/x2go/backends/proxy/_nx3.py @@ -38,8 +38,6 @@ import x2go.log as log import base from x2go.defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS -from x2go.defaults import LOCAL_HOME as _LOCAL_HOME -from x2go.defaults import X2GO_SESSION_ROOTDIR as _X2GO_SESSION_ROOTDIR class X2goProxyNX3(base.X2goProxyBASE): """\ @@ -55,7 +53,7 @@ class X2goProxyNX3(base.X2goProxyBASE): """ base.X2goProxyBASE.__init__(self, *args, **kwargs) - + # setting some default environment variables, nxproxy paths etc. if _X2GOCLIENT_OS == "Windows": _nxproxy_paths = [ @@ -72,7 +70,7 @@ class X2goProxyNX3(base.X2goProxyBASE): self.PROXY_CMD = "/usr/bin/nxproxy" self.PROXY_ENV.update({ "NX_CLIENT": "/bin/true", - "NX_ROOT": os.path.join(_LOCAL_HOME, _X2GO_SESSION_ROOTDIR) + "NX_ROOT": self.session_rootdir }) self.PROXY_MODE = '-S' if _X2GOCLIENT_OS == "Windows": diff --git a/x2go/backends/proxy/base.py b/x2go/backends/proxy/base.py index b894d91..585492e 100644 --- a/x2go/backends/proxy/base.py +++ b/x2go/backends/proxy/base.py @@ -68,7 +68,10 @@ class X2goProxyBASE(threading.Thread): fw_tunnel = None proxy = None - def __init__(self, session_info=None, ssh_transport=None, session_log="session.log", logger=None, loglevel=log.loglevel_DEFAULT, ): + def __init__(self, session_info=None, + session_rootdir=os.path.join(_LOCAL_HOME, _X2GO_SESSION_ROOTDIR), + ssh_transport=None, session_log="session.log", + logger=None, loglevel=log.loglevel_DEFAULT, ): """\ @param session_info: session information provided as an C{X2goServerSessionInfo} backend class object @@ -91,6 +94,7 @@ class X2goProxyBASE(threading.Thread): self.logger = copy.deepcopy(logger) self.logger.tag = __NAME__ + self.session_rootdir = session_rootdir self.session_info = session_info self.ssh_transport = ssh_transport self.session_log = session_log diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py index d199f3d..f7e8c8e 100644 --- a/x2go/backends/terminal/_stdout.py +++ b/x2go/backends/terminal/_stdout.py @@ -50,6 +50,7 @@ from x2go.cleanup import x2go_cleanup # we hide the default values from epydoc (that's why we transform them to _UNDERSCORE variables) from x2go.defaults import LOCAL_HOME as _LOCAL_HOME from x2go.defaults import CURRENT_LOCAL_USER as _CURRENT_LOCAL_USER +from x2go.defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR from x2go.defaults import X2GO_SESSION_ROOTDIR as _X2GO_SESSION_ROOTDIR from x2go.backends.info import X2goServerSessionInfo as _X2goServerSessionInfo @@ -224,6 +225,8 @@ class X2goTerminalSessionSTDOUT(object): list_backend=_X2goServerSessionList, proxy_backend=_X2goProxy, printing_backend=_X2goClientPrinting, + client_rootdir=os.path.join(_LOCAL_HOME, _X2GO_CLIENT_ROOTDIR), + session_rootdir=os.path.join(_LOCAL_HOME, _X2GO_SESSION_ROOTDIR), client_instance=None, logger=None, loglevel=log.loglevel_DEFAULT): """\ @@ -249,6 +252,9 @@ class X2goTerminalSessionSTDOUT(object): self.control_session = control_session self.reverse_tunnels = self.control_session.get_transport().reverse_tunnels + self.client_rootdir = client_rootdir + self.session_rootdir = session_rootdir + self.params = X2goSessionParams() self.params.geometry = geometry @@ -265,7 +271,7 @@ class X2goTerminalSessionSTDOUT(object): self.params.rdp_server = rdp_server self.params.rdp_options = rdp_options - self.params.rootdir = (type(rootdir) is types.StringType) and rootdir or os.path.join(_LOCAL_HOME,_X2GO_SESSION_ROOTDIR) + self.params.rootdir = (type(rootdir) is types.StringType) and rootdir or self.session_rootdir self.params.update() self.profile_name = profile_name @@ -668,13 +674,15 @@ class X2goTerminalSessionSTDOUT(object): # local path may be a Windows path, so we use the path separator of the local system self.session_info.local_container = os.path.join(self.params.rootdir, 'S-%s' % self.session_info.name) # remote path is always a UniX path... - self.session_info.remote_container = '%s/%s/C-%s' % (self.control_session._x2go_remote_home, - _X2GO_SESSION_ROOTDIR, - self.session_info.name, - ) + self.session_info.remote_container = '%s/.x2go/C-%s' % (self.control_session._x2go_remote_home, + self.session_info.name, + ) # set up SSH tunnel for X11 graphical elements - self.proxy = self.proxy_class(session_info=self.session_info, ssh_transport=self.control_session.get_transport(), logger=self.logger) + self.proxy = self.proxy_class(session_info=self.session_info, + session_rootdir=self.session_rootdir, + ssh_transport=self.control_session.get_transport(), + logger=self.logger) self.proxy_subprocess = self.proxy.start_proxy() self.active_threads.append(self.proxy) @@ -712,10 +720,9 @@ class X2goTerminalSessionSTDOUT(object): # local path may be a Windows path, so we use the path separator of the local system self.session_info.local_container = os.path.join(self.params.rootdir, 'S-%s' % self.session_info.name) # remote path is always a UniX path... - self.session_info.remote_container = '%s/%s/C-%s' % (self.control_session._x2go_remote_home, - _X2GO_SESSION_ROOTDIR, - self.session_info.name, - ) + self.session_info.remote_container = '%s/.x2go/C-%s' % (self.control_session._x2go_remote_home, + self.session_info.name, + ) return self.ok() def suspend(self): diff --git a/x2go/client.py b/x2go/client.py index 1f43f3f..3a483bf 100644 --- a/x2go/client.py +++ b/x2go/client.py @@ -136,6 +136,8 @@ from defaults import X2GOCLIENT_OS as _X2GOCLIENT_OS from defaults import LOCAL_HOME as _LOCAL_HOME from defaults import CURRENT_LOCAL_USER as _CURRENT_LOCAL_USER from defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR +from defaults import X2GO_SESSION_ROOTDIR as _X2GO_SESSION_ROOTDIR +from defaults import X2GO_SSH_ROOTDIR as _X2GO_SSH_ROOTDIR from x2go.backends.control import X2goControlSession as _X2goControlSession from x2go.backends.terminal import X2goTerminalSession as _X2goTerminalSession @@ -169,6 +171,9 @@ class X2goClient(object): profiles_backend=_X2goSessionProfiles, settings_backend=_X2goClientSettings, printing_backend=_X2goClientPrinting, + client_rootdir=os.path.join(_LOCAL_HOME, _X2GO_CLIENT_ROOTDIR), + session_rootdir=os.path.join(_LOCAL_HOME, _X2GO_SESSION_ROOTDIR), + ssh_rootdir=os.path.join(_LOCAL_HOME, _X2GO_SSH_ROOTDIR), logger=None, loglevel=log.loglevel_DEFAULT): """\ @param logger: you can pass an L{X2goLogger} object to the @@ -197,6 +202,10 @@ class X2goClient(object): self.settings_backend = settings_backend self.printing_backend = printing_backend + self.client_rootdir = client_rootdir + self.session_rootdir = session_rootdir + self.ssh_rootdir = ssh_rootdir + if _X2GOCLIENT_OS == 'Windows' and start_xserver: self.client_xconfig = X2goClientXConfig(logger=self.logger) if not self.client_xconfig.known_server: @@ -380,6 +389,9 @@ class X2goClient(object): proxy_backend=self.proxy_backend, settings_backend=self.settings_backend, printing_backend=self.printing_backend, + client_rootdir=self.client_rootdir, + session_rootdir=self.session_rootdir, + ssh_rootdir=self.ssh_rootdir, **_params) self.logger('initializing X2go session...', log.loglevel_NOTICE, tag=self._logger_tag) diff --git a/x2go/defaults.py b/x2go/defaults.py index 24b606e..1f17cba 100644 --- a/x2go/defaults.py +++ b/x2go/defaults.py @@ -37,6 +37,7 @@ X2GOCLIENT_OS = platform.system() LOCAL_HOME = os.path.expanduser('~') X2GO_SESSION_ROOTDIR = '.x2go' X2GO_CLIENT_ROOTDIR = '.x2goclient' +X2GO_SSH_ROOTDIR = os.path.join('.x2go','.ssh') # setting OS dependent variables if X2GOCLIENT_OS == "Windows": diff --git a/x2go/mime_export.py b/x2go/mime_export.py index 8e5a864..7302ca0 100644 --- a/x2go/mime_export.py +++ b/x2go/mime_export.py @@ -42,8 +42,6 @@ if sys.platform == 'win32': import log import defaults # we hide the default values from epydoc (that's why we transform them to _UNDERSCORE variables) -from defaults import LOCAL_HOME as _LOCAL_HOME -from defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR from defaults import X2GO_CLIENTPRINTING_DEFAULTS as _X2GO_CLIENTPRINTING_DEFAULTS from defaults import X2GO_PRINTING_CONFIGFILES as _X2GO_PRINTING_CONFIGFILES import utils diff --git a/x2go/printactions.py b/x2go/printactions.py index 40e4740..a895161 100644 --- a/x2go/printactions.py +++ b/x2go/printactions.py @@ -48,8 +48,6 @@ else: import log import defaults # we hide the default values from epydoc (that's why we transform them to _UNDERSCORE variables) -from defaults import LOCAL_HOME as _LOCAL_HOME -from defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR import utils import x2go_exceptions diff --git a/x2go/printqueue.py b/x2go/printqueue.py index bff0892..266ba61 100644 --- a/x2go/printqueue.py +++ b/x2go/printqueue.py @@ -37,8 +37,6 @@ import gevent import log import defaults # we hide the default values from epydoc (that's why we transform them to _UNDERSCORE variables) -from defaults import LOCAL_HOME as _LOCAL_HOME -from defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR from backends.printing import X2goClientPrinting as _X2goClientPrinting diff --git a/x2go/registry.py b/x2go/registry.py index 3b03b31..acdb5d4 100644 --- a/x2go/registry.py +++ b/x2go/registry.py @@ -22,6 +22,7 @@ X2goSessionRegistry class - the X2goClient's session registry backend """ __NAME__ = 'x2gosessregistry-pylib' +import os import copy import types import uuid @@ -43,6 +44,11 @@ from x2go.backends.proxy import X2goProxy as _X2goProxy from x2go.backends.settings import X2goClientSettings as _X2goClientSettings from x2go.backends.printing import X2goClientPrinting as _X2goClientPrinting +from defaults import LOCAL_HOME as _LOCAL_HOME +from defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR +from defaults import X2GO_SESSION_ROOTDIR as _X2GO_SESSION_ROOTDIR +from defaults import X2GO_SSH_ROOTDIR as _X2GO_SSH_ROOTDIR + class X2goSessionRegistry(object): """\ STILL UNDOCUMENTED @@ -127,6 +133,9 @@ class X2goSessionRegistry(object): proxy_backend=_X2goProxy, settings_backend=_X2goClientSettings, printing_backend=_X2goClientPrinting, + client_rootdir=os.path.join(_LOCAL_HOME,_X2GO_CLIENT_ROOTDIR), + session_rootdir=os.path.join(_LOCAL_HOME,_X2GO_SESSION_ROOTDIR), + ssh_rootdir=os.path.join(_LOCAL_HOME,_X2GO_SSH_ROOTDIR), **kwargs): control_session = None @@ -142,6 +151,9 @@ class X2goSessionRegistry(object): proxy_backend=proxy_backend, settings_backend=settings_backend, printing_backend=printing_backend, + client_rootdir=client_rootdir, + session_rootdir=session_rootdir, + ssh_rootdir=ssh_rootdir, logger=self.logger, **kwargs) session_uuid = s._X2goSession__get_uuid() diff --git a/x2go/session.py b/x2go/session.py index da8a3bc..7ad9c30 100644 --- a/x2go/session.py +++ b/x2go/session.py @@ -22,6 +22,7 @@ X2goSession class - the X2goClient's session backend """ __NAME__ = 'x2gosession-pylib' +import os import copy import types import uuid @@ -43,6 +44,11 @@ from x2go.backends.profiles import X2goSessionProfiles as _X2goSessionProfiles from x2go.backends.settings import X2goClientSettings as _X2goClientSettings from x2go.backends.printing import X2goClientPrinting as _X2goClientPrinting +from defaults import LOCAL_HOME as _LOCAL_HOME +from defaults import X2GO_CLIENT_ROOTDIR as _X2GO_CLIENT_ROOTDIR +from defaults import X2GO_SESSION_ROOTDIR as _X2GO_SESSION_ROOTDIR +from defaults import X2GO_SSH_ROOTDIR as _X2GO_SSH_ROOTDIR + from defaults import SUPPORTED_SOUND, SUPPORTED_PRINTING, SUPPORTED_FOLDERSHARING # options of the paramiko.SSHClient().connect() @@ -70,6 +76,9 @@ class X2goSession(object): proxy_backend=_X2goProxy, settings_backend=_X2goClientSettings, printing_backend=_X2goClientPrinting, + client_rootdir=os.path.join(_LOCAL_HOME, _X2GO_CLIENT_ROOTDIR), + session_rootdir=os.path.join(_LOCAL_HOME, _X2GO_SESSION_ROOTDIR), + ssh_rootdir=os.path.join(_LOCAL_HOME, _X2GO_SSH_ROOTDIR), known_hosts=None, logger=None, loglevel=log.loglevel_DEFAULT, **params): @@ -100,6 +109,9 @@ class X2goSession(object): self._proxy_backend = proxy_backend self._settings_backend = settings_backend self._printing_backend = printing_backend + self.client_rootdir = client_rootdir + self.session_rootdir = session_rootdir + self.ssh_rootdir = ssh_rootdir # the client instance is not deeply copiable _client_instance=None @@ -134,6 +146,9 @@ class X2goSession(object): info_backend=info_backend, list_backend=list_backend, proxy_backend=proxy_backend, + client_rootdir=client_rootdir, + session_rootdir=session_rootdir, + ssh_rootdir=ssh_rootdir, logger=logger) else: self.control_session = control_session 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).