The branch, twofactorauth has been updated via 77c5ce1296b305d50e72683ac31dc53a559ca743 (commit) from 83aac18e0c9d14234efcad2226bf7535bfe9c5a3 (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/_gconf.py | 39 +------ x2go/backends/printing/_httpsbroker.py | 113 -------------------- x2go/backends/printing/_winreg.py | 39 +------ x2go/backends/profiles/_gconf.py | 183 +------------------------------- x2go/backends/profiles/_httpsbroker.py | 171 +---------------------------- x2go/backends/profiles/_winreg.py | 182 +------------------------------ x2go/backends/settings/__init__.py | 1 - x2go/backends/settings/_gconf.py | 3 +- x2go/backends/settings/_httpsbroker.py | 64 ----------- x2go/backends/settings/_winreg.py | 2 +- x2go/x2go_exceptions.py | 1 + 11 files changed, 11 insertions(+), 787 deletions(-) delete mode 100644 x2go/backends/printing/_httpsbroker.py delete mode 100644 x2go/backends/settings/_httpsbroker.py The diff of changes is: diff --git a/x2go/backends/printing/_gconf.py b/x2go/backends/printing/_gconf.py index 89d72f4..d36aa9a 100644 --- a/x2go/backends/printing/_gconf.py +++ b/x2go/backends/printing/_gconf.py @@ -40,6 +40,8 @@ from x2go.defaults import X2GO_CLIENTPRINTING_DEFAULTS as _X2GO_CLIENTPRINTING_D from x2go.defaults import X2GO_PRINTING_CONFIGFILES as _X2GO_PRINTING_CONFIGFILES import x2go.inifiles as inifiles +from x2go.x2go_exceptions import * + class X2goClientPrintingGCONF(inifiles.X2goIniFile): """\ L{X2goClientPrinting} provides access to the X2go ini-like file @@ -73,41 +75,6 @@ class X2goClientPrintingGCONF(inifiles.X2goIniFile): @type loglevel: C{int} """ - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) - - self._detect_print_action() - - - def _detect_print_action(self): - """\ - Derive a print action from sections, keys and their values in a typical - X2go client »printing« configuration file. - - """ - _general_pdfview = self.get('General', 'pdfview', key_type=types.BooleanType) - _view_open = self.get('view', 'open', key_type=types.BooleanType) - _print_startcmd = self.get('print', 'startcmd', key_type=types.BooleanType) + raise X2goNotImplementedYetException('GCONF backend support is not implemented yet') - if _general_pdfview and _view_open: - _view_command = self.get('view', 'command') - self._print_action = printactions.X2goPrintActionPDFVIEW(pdfview_cmd=_view_command, logger=self.logger) - - elif _general_pdfview and not _view_open: - self._print_action = printactions.X2goPrintActionPDFSAVE(logger=self.logger) - - elif not _general_pdfview and not _print_startcmd: - _cups_defaultprinter = self.get('CUPS', 'defaultprinter') - self._print_action = printactions.X2goPrintActionPRINT(printer=_cups_defaultprinter, logger=self.logger) - - elif not _general_pdfview and _print_startcmd: - _print_command = self.get('print', 'command') - self._print_action = printactions.X2goPrintActionPRINTCMD(print_cmd=_print_command, logger=self.logger) - - @property - def print_action(self): - """\ - Return the print action described by the »printing« configuration file. - - """ - return self._print_action diff --git a/x2go/backends/printing/_httpsbroker.py b/x2go/backends/printing/_httpsbroker.py deleted file mode 100644 index fd6ad97..0000000 --- a/x2go/backends/printing/_httpsbroker.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Copyright (C) 2010 by Mike Gabriel <m.gabriel@das-netzwerkteam.de> -# -# Python X2go is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Python X2go is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -"""\ -L{X2goClientPrintingWINREG} class is one of Python X2go's public API classes. - -Retrieve an instance of this class from your L{X2goClient} instance. -Use this class in your Python X2go based applications to access the »printing« -configuration of your X2go client application. - -""" -__NAME__ = 'x2goprint-pylib' - -# modules -import types -import ConfigParser - -# Python X2go modules -import x2go.log as log -import x2go.printactions as printactions -# we hide the default values from epydoc (that's why we transform them to _UNDERSCORE variables) -from x2go.defaults import X2GO_CLIENTPRINTING_DEFAULTS as _X2GO_CLIENTPRINTING_DEFAULTS -from x2go.defaults import X2GO_PRINTING_CONFIGFILES as _X2GO_PRINTING_CONFIGFILES -import x2go.inifiles as inifiles - -class X2goClientPrintingWINREG(inifiles.X2goIniFile): - """\ - L{X2goClientPrinting} provides access to the X2go ini-like file - »printing« as stored in C{~/.x2goclient/printing} resp. globally - C{/etc/x2goclient/printing}. - - An instance of L{X2goClientPrinting} is created on each incoming - print job. This facilitates that on every print job the print action - for this job is derived from the »printing« configuration file. - - Thus, changes on the file are active for the next incoming print job. - - """ - config_files = [] - _print_action = None - defaultValues = _X2GO_CLIENTPRINTING_DEFAULTS - - def __init__(self, config_files=_X2GO_PRINTING_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT): - """\ - @param config_files: a list of configuration files names (e.g. a global filename and a user's home - directory filename) - @type config_files: C{list} - @param defaults: a cascaded Python dicitionary structure with ini file defaults (to override - Python X2go's hard coded defaults in L{defaults} - @type defaults: C{dict} - @param logger: you can pass an L{X2goLogger} object to the - L{X2goPrintAction} constructor - @type logger: C{instance} - @param loglevel: if no L{X2goLogger} object has been supplied a new one will be - constructed with the given loglevel - @type loglevel: C{int} - - """ - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) - - self._detect_print_action() - - - def _detect_print_action(self): - """\ - Derive a print action from sections, keys and their values in a typical - X2go client »printing« configuration file. - - """ - _general_pdfview = self.get('General', 'pdfview', key_type=types.BooleanType) - _view_open = self.get('view', 'open', key_type=types.BooleanType) - _print_startcmd = self.get('print', 'startcmd', key_type=types.BooleanType) - - if _general_pdfview and _view_open: - _view_command = self.get('view', 'command') - self._print_action = printactions.X2goPrintActionPDFVIEW(pdfview_cmd=_view_command, logger=self.logger) - - elif _general_pdfview and not _view_open: - self._print_action = printactions.X2goPrintActionPDFSAVE(logger=self.logger) - - elif not _general_pdfview and not _print_startcmd: - _cups_defaultprinter = self.get('CUPS', 'defaultprinter') - self._print_action = printactions.X2goPrintActionPRINT(printer=_cups_defaultprinter, logger=self.logger) - - elif not _general_pdfview and _print_startcmd: - _print_command = self.get('print', 'command') - self._print_action = printactions.X2goPrintActionPRINTCMD(print_cmd=_print_command, logger=self.logger) - - @property - def print_action(self): - """\ - Return the print action described by the »printing« configuration file. - - """ - return self._print_action - diff --git a/x2go/backends/printing/_winreg.py b/x2go/backends/printing/_winreg.py index fd6ad97..23254ee 100644 --- a/x2go/backends/printing/_winreg.py +++ b/x2go/backends/printing/_winreg.py @@ -73,41 +73,4 @@ class X2goClientPrintingWINREG(inifiles.X2goIniFile): @type loglevel: C{int} """ - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) - - self._detect_print_action() - - - def _detect_print_action(self): - """\ - Derive a print action from sections, keys and their values in a typical - X2go client »printing« configuration file. - - """ - _general_pdfview = self.get('General', 'pdfview', key_type=types.BooleanType) - _view_open = self.get('view', 'open', key_type=types.BooleanType) - _print_startcmd = self.get('print', 'startcmd', key_type=types.BooleanType) - - if _general_pdfview and _view_open: - _view_command = self.get('view', 'command') - self._print_action = printactions.X2goPrintActionPDFVIEW(pdfview_cmd=_view_command, logger=self.logger) - - elif _general_pdfview and not _view_open: - self._print_action = printactions.X2goPrintActionPDFSAVE(logger=self.logger) - - elif not _general_pdfview and not _print_startcmd: - _cups_defaultprinter = self.get('CUPS', 'defaultprinter') - self._print_action = printactions.X2goPrintActionPRINT(printer=_cups_defaultprinter, logger=self.logger) - - elif not _general_pdfview and _print_startcmd: - _print_command = self.get('print', 'command') - self._print_action = printactions.X2goPrintActionPRINTCMD(print_cmd=_print_command, logger=self.logger) - - @property - def print_action(self): - """\ - Return the print action described by the »printing« configuration file. - - """ - return self._print_action - + raise X2goNotImplementedYetException('WINREG backend support is not implemented yet') diff --git a/x2go/backends/profiles/_gconf.py b/x2go/backends/profiles/_gconf.py index 1093717..7546466 100644 --- a/x2go/backends/profiles/_gconf.py +++ b/x2go/backends/profiles/_gconf.py @@ -48,185 +48,4 @@ class X2goSessionProfilesGCONF(inifiles.X2goIniFile): STILL UNDOCUMENTED """ - self.defaultValues = {} - - if logger is None: - self.logger = log.X2goLogger(loglevel=loglevel) - else: - self.logger = copy.deepcopy(logger) - self.logger.tag = __NAME__ - - # providing defaults for an X2goSessionProfiles instance will---in the worst case---override your - # existing sessions file in your home directory once you write the sessions back to file... - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) - - if utils._checkSessionProfileDefaults(session_profile_defaults): - self.defaultSessionProfile = session_profile_defaults - - self.session_profiles = self.iniConfig.sections() - for session_profile in self.session_profiles: - for key, default_value in self.defaultSessionProfile.iteritems(): - if not self.iniConfig.has_option(session_profile, key): - self._storeValue(session_profile, key, default_value) - self._updateDataObject() - - def __call__(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = check_profile_id_or_name(self, profile_id_or_name) - return self.get_profile_config(_profile_id) - - def get_profile_option_type(self, option): - """\ - STILL UNDOCUMENTED - - """ - return type(self.defaultSessionProfile[option]) - - def get_profile_config(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - _profile_config = {} - for option in self.iniConfig.options(_profile_id): - _profile_config[option] = self.get(_profile_id, option, key_type=self.get_profile_option_type(option)) - return _profile_config or None - - def has_profile(self, profile_id_or_name): - try: - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - return True - except X2goProfileException: - return False - - @property - def profile_ids(self): - """\ - STILL UNDOCUMENTED - - """ - return [ s for s in self.iniConfig.sections() if s not in self._non_profile_sections ] - - def has_profile_id(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - return profile_id in self.profile_ids - - @property - def profile_names(self): - """\ - STILL UNDOCUMENTED - - """ - return [ self.to_profile_name(p) for p in self.profile_ids ] - - def has_profile_name(self, profile_name): - """\ - STILL UNDOCUMENTED - - """ - return profile_name in self.profile_names - - def to_profile_id(self, profile_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_ids = [ p for p in self.profile_ids if self.to_profile_name(p) == profile_name ] - if len(_profile_ids) == 1: - return _profile_ids[0] - elif len(_profile_ids) == 0: - return None - else: - raise X2goProfileException('The sessions config file contains multiple session profiles with name: %s' % profile_name) - - def to_profile_name(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - return self.get_profile_config(profile_id)['name'] - - def add_profile(self, profile_id=None, **kwargs): - """\ - STILL UNDOCUMENTED - - """ - if profile_id is None: - profile_id = utils._genSessionProfileId() - for key, value in kwargs.items(): - if key in self.defaultSessionProfile: - self.update_value(profile_id, key, value) - else: - raise X2goProfileException('keyword ,,%s\'\' not supported in X2go session profile' % key) - - for key, value in self.defaultSessionProfile.items(): - if key in kwargs: continue - self._storeValueTypes(profile_id, key, value) - - def delete_profile(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - self.iniConfig.remove_section(profile_id) - self.write_user_config = True - self.writeIniFile() - - def has_default_profiles(self): - """\ - STILL UNDOCUMENTED - - """ - return self.get_default_profiles() and True or False - - def get_default_profiles(self): - """\ - Find profiles marked as default profiles. If appropriate, default - profiles may be started immediately on client startup. - - """ - _default_profiles = [] - for profile_name in self.profile_names: - _profile_id = self.to_profile_id(profile_name) - _profile_config = self.get_profile_config(profile_name) - if _profile_config['default']: - _default_profiles.append(_profile_id) - return _default_profiles - - def check_profile_id_or_name(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = None - if self.has_profile_id(profile_id_or_name): - # we were given a session profile id... - _profile_id = profile_id_or_name - elif self.has_profile_name(profile_id_or_name): - # we were given a sesion profile name... - _profile_id = self.to_profile_id(profile_id_or_name) - if not _profile_id: - raise X2goProfileException('No session profile with id or name %s exists.' % profile_id_or_name) - return _profile_id - - def to_session_params(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - return utils._convert_SessionProfileOptions_2_SessionParams(self.get_profile_config(_profile_id)) - - def get_session_param(self, profile_id_or_name, param): - """\ - STILL UNDOCUMENTED - - """ - return self.to_session_params(profile_id_or_name)[param] + raise X2goNotImplementedYetException('GCONF backend support is not implemented yet') diff --git a/x2go/backends/profiles/_httpsbroker.py b/x2go/backends/profiles/_httpsbroker.py index 56b37b2..27e6d87 100644 --- a/x2go/backends/profiles/_httpsbroker.py +++ b/x2go/backends/profiles/_httpsbroker.py @@ -47,173 +47,4 @@ class X2goSessionProfilesHTTPSBROKER(inifiles.X2goIniFile): STILL UNDOCUMENTED """ - self.defaultValues = {} - - if logger is None: - self.logger = log.X2goLogger(loglevel=loglevel) - else: - self.logger = copy.deepcopy(logger) - self.logger.tag = __NAME__ - - # providing defaults for an X2goSessionProfiles instance will---in the worst case---override your - # existing sessions file in your home directory once you write the sessions back to file... - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) - - if utils._checkSessionProfileDefaults(session_profile_defaults): - self.defaultSessionProfile = session_profile_defaults - - self.session_profiles = self.iniConfig.sections() - for session_profile in self.session_profiles: - for key, default_value in self.defaultSessionProfile.iteritems(): - if not self.iniConfig.has_option(session_profile, key): - self._storeValue(session_profile, key, default_value) - self._updateDataObject() - - def __call__(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = check_profile_id_or_name(self, profile_id_or_name) - return self.get_profile_config(_profile_id) - - def get_profile_option_type(self, option): - """\ - STILL UNDOCUMENTED - - """ - return type(self.defaultSessionProfile[option]) - - def get_profile_config(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - _profile_config = {} - for option in self.iniConfig.options(_profile_id): - _profile_config[option] = self.get(_profile_id, option, key_type=self.get_profile_option_type(option)) - return _profile_config or None - - def has_profile(self, profile_id_or_name): - try: - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - return True - except X2goProfileException: - return False - - @property - def profile_ids(self): - """\ - STILL UNDOCUMENTED - - """ - return [ s for s in self.iniConfig.sections() if s not in self._non_profile_sections ] - - def has_profile_id(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - return profile_id in self.profile_ids - - @property - def profile_names(self): - """\ - STILL UNDOCUMENTED - - """ - return [ self.to_profile_name(p) for p in self.profile_ids ] - - def has_profile_name(self, profile_name): - """\ - STILL UNDOCUMENTED - - """ - return profile_name in self.profile_names - - def to_profile_id(self, profile_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_ids = [ p for p in self.profile_ids if self.to_profile_name(p) == profile_name ] - if len(_profile_ids) == 1: - return _profile_ids[0] - elif len(_profile_ids) == 0: - return None - else: - raise X2goProfileException('The sessions config file contains multiple session profiles with name: %s' % profile_name) - - def to_profile_name(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - return self.get_profile_config(profile_id)['name'] - - def add_profile(self, profile_id=None, **kwargs): - """\ - STILL UNDOCUMENTED - - """ - pass - - def delete_profile(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - pass - - def has_default_profiles(self): - """\ - STILL UNDOCUMENTED - - """ - return self.get_default_profiles() and True or False - - def get_default_profiles(self): - """\ - Find profiles marked as default profiles. If appropriate, default - profiles may be started immediately on client startup. - - """ - _default_profiles = [] - for profile_name in self.profile_names: - _profile_id = self.to_profile_id(profile_name) - _profile_config = self.get_profile_config(profile_name) - if _profile_config['default']: - _default_profiles.append(_profile_id) - return _default_profiles - - def check_profile_id_or_name(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = None - if self.has_profile_id(profile_id_or_name): - # we were given a session profile id... - _profile_id = profile_id_or_name - elif self.has_profile_name(profile_id_or_name): - # we were given a sesion profile name... - _profile_id = self.to_profile_id(profile_id_or_name) - if not _profile_id: - raise X2goProfileException('No session profile with id or name %s exists.' % profile_id_or_name) - return _profile_id - - def to_session_params(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - return utils._convert_SessionProfileOptions_2_SessionParams(self.get_profile_config(_profile_id)) - - def get_session_param(self, profile_id_or_name, param): - """\ - STILL UNDOCUMENTED - - """ - return self.to_session_params(profile_id_or_name)[param] + raise X2goNotImplementedYetException('HTTPSBROKER backend support is not implemented yet') diff --git a/x2go/backends/profiles/_winreg.py b/x2go/backends/profiles/_winreg.py index 86f8fe7..1d3badd 100644 --- a/x2go/backends/profiles/_winreg.py +++ b/x2go/backends/profiles/_winreg.py @@ -48,185 +48,5 @@ class X2goSessionProfilesWINREG(inifiles.X2goIniFile): STILL UNDOCUMENTED """ - self.defaultValues = {} + raise X2goNotImplementedYetException('WINREG backend support is not implemented yet') - if logger is None: - self.logger = log.X2goLogger(loglevel=loglevel) - else: - self.logger = copy.deepcopy(logger) - self.logger.tag = __NAME__ - - # providing defaults for an X2goSessionProfiles instance will---in the worst case---override your - # existing sessions file in your home directory once you write the sessions back to file... - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) - - if utils._checkSessionProfileDefaults(session_profile_defaults): - self.defaultSessionProfile = session_profile_defaults - - self.session_profiles = self.iniConfig.sections() - for session_profile in self.session_profiles: - for key, default_value in self.defaultSessionProfile.iteritems(): - if not self.iniConfig.has_option(session_profile, key): - self._storeValue(session_profile, key, default_value) - self._updateDataObject() - - def __call__(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = check_profile_id_or_name(self, profile_id_or_name) - return self.get_profile_config(_profile_id) - - def get_profile_option_type(self, option): - """\ - STILL UNDOCUMENTED - - """ - return type(self.defaultSessionProfile[option]) - - def get_profile_config(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - _profile_config = {} - for option in self.iniConfig.options(_profile_id): - _profile_config[option] = self.get(_profile_id, option, key_type=self.get_profile_option_type(option)) - return _profile_config or None - - def has_profile(self, profile_id_or_name): - try: - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - return True - except X2goProfileException: - return False - - @property - def profile_ids(self): - """\ - STILL UNDOCUMENTED - - """ - return [ s for s in self.iniConfig.sections() if s not in self._non_profile_sections ] - - def has_profile_id(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - return profile_id in self.profile_ids - - @property - def profile_names(self): - """\ - STILL UNDOCUMENTED - - """ - return [ self.to_profile_name(p) for p in self.profile_ids ] - - def has_profile_name(self, profile_name): - """\ - STILL UNDOCUMENTED - - """ - return profile_name in self.profile_names - - def to_profile_id(self, profile_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_ids = [ p for p in self.profile_ids if self.to_profile_name(p) == profile_name ] - if len(_profile_ids) == 1: - return _profile_ids[0] - elif len(_profile_ids) == 0: - return None - else: - raise X2goProfileException('The sessions config file contains multiple session profiles with name: %s' % profile_name) - - def to_profile_name(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - return self.get_profile_config(profile_id)['name'] - - def add_profile(self, profile_id=None, **kwargs): - """\ - STILL UNDOCUMENTED - - """ - if profile_id is None: - profile_id = utils._genSessionProfileId() - for key, value in kwargs.items(): - if key in self.defaultSessionProfile: - self.update_value(profile_id, key, value) - else: - raise X2goProfileException('keyword ,,%s\'\' not supported in X2go session profile' % key) - - for key, value in self.defaultSessionProfile.items(): - if key in kwargs: continue - self._storeValueTypes(profile_id, key, value) - - def delete_profile(self, profile_id): - """\ - STILL UNDOCUMENTED - - """ - self.iniConfig.remove_section(profile_id) - self.write_user_config = True - self.writeIniFile() - - def has_default_profiles(self): - """\ - STILL UNDOCUMENTED - - """ - return self.get_default_profiles() and True or False - - def get_default_profiles(self): - """\ - Find profiles marked as default profiles. If appropriate, default - profiles may be started immediately on client startup. - - """ - _default_profiles = [] - for profile_name in self.profile_names: - _profile_id = self.to_profile_id(profile_name) - _profile_config = self.get_profile_config(profile_name) - if _profile_config['default']: - _default_profiles.append(_profile_id) - return _default_profiles - - def check_profile_id_or_name(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = None - if self.has_profile_id(profile_id_or_name): - # we were given a session profile id... - _profile_id = profile_id_or_name - elif self.has_profile_name(profile_id_or_name): - # we were given a sesion profile name... - _profile_id = self.to_profile_id(profile_id_or_name) - if not _profile_id: - raise X2goProfileException('No session profile with id or name %s exists.' % profile_id_or_name) - return _profile_id - - def to_session_params(self, profile_id_or_name): - """\ - STILL UNDOCUMENTED - - """ - _profile_id = self.check_profile_id_or_name(profile_id_or_name) - return utils._convert_SessionProfileOptions_2_SessionParams(self.get_profile_config(_profile_id)) - - def get_session_param(self, profile_id_or_name, param): - """\ - STILL UNDOCUMENTED - - """ - return self.to_session_params(profile_id_or_name)[param] diff --git a/x2go/backends/settings/__init__.py b/x2go/backends/settings/__init__.py index fd66188..2883edc 100644 --- a/x2go/backends/settings/__init__.py +++ b/x2go/backends/settings/__init__.py @@ -21,7 +21,6 @@ from x2go.defaults import BACKEND_CLIENTSETTINGS_DEFAULT from _file import X2goClientSettingsFILE from _gconf import X2goClientSettingsGCONF -from _httpsbroker import X2goClientSettingsHTTPSBROKER from _winreg import X2goClientSettingsWINREG X2goClientSettings = eval(BACKEND_CLIENTSETTINGS_DEFAULT) diff --git a/x2go/backends/settings/_gconf.py b/x2go/backends/settings/_gconf.py index ab8442e..4b9ff9a 100644 --- a/x2go/backends/settings/_gconf.py +++ b/x2go/backends/settings/_gconf.py @@ -61,4 +61,5 @@ class X2goClientSettingsGCONF(inifiles.X2goIniFile): C{/etc/x2goclient/settings}. """ - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) + raise X2goNotImplementedYetException('GCONF backend support is not implemented yet') + diff --git a/x2go/backends/settings/_httpsbroker.py b/x2go/backends/settings/_httpsbroker.py deleted file mode 100644 index e143529..0000000 --- a/x2go/backends/settings/_httpsbroker.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (C) 2010 by Mike Gabriel <m.gabriel@das-netzwerkteam.de> -# -# Python X2go is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Python X2go is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the -# Free Software Foundation, Inc., -# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - -"""\ -X2goClientSettings class - managing x2goclient settings file (incl. LDAP-Support). - -The L{X2goClientSettings} class one of Python X2go's a public API classes. -Use this class (indirectly by retrieving it from an L{X2goClient} instance) -in your Python X2go based applications to access the -»settings« configuration file of your X2go client application. - -""" -__NAME__ = 'x2gosettings-pylib' - -# modules -import os - -# Python X2go modules -import x2go.log as log -from x2go.defaults import X2GO_SETTINGS_CONFIGFILES as _X2GO_SETTINGS_CONFIGFILES -from x2go.defaults import X2GO_CLIENTSETTINGS_DEFAULTS as _X2GO_CLIENTSETTINGS_DEFAULTS -import x2go.inifiles as inifiles - - -class X2goClientSettingsHTTPSBROKER(inifiles.X2goIniFile): - """\ - Configuration file based settings for X2goClient instances. - - """ - defaultValues = _X2GO_CLIENTSETTINGS_DEFAULTS - - def __init__(self, config_files=_X2GO_SETTINGS_CONFIGFILES, defaults=None, logger=None, loglevel=log.loglevel_DEFAULT): - """\ - Constructs an L{X2goClientSettings} instance. This is normally done by an L{X2goClient} instance. - You can retrieve this L{X2goClientSettings} instance with the L{X2goClient.get_client_settings()} - method. - - On construction the L{X2goClientSettings} object is filled with values from the configuration files:: - - /etc/x2goclient/settings - ~/.x2goclient/settings - - The files are read in the specified order and config options of both files are merged. Options - set in the user configuration file (C{~/.x2goclient/settings}) override global options set in - C{/etc/x2goclient/settings}. - - """ - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) diff --git a/x2go/backends/settings/_winreg.py b/x2go/backends/settings/_winreg.py index b8a6fef..27c73d9 100644 --- a/x2go/backends/settings/_winreg.py +++ b/x2go/backends/settings/_winreg.py @@ -61,4 +61,4 @@ class X2goClientSettingsWINREG(inifiles.X2goIniFile): C{/etc/x2goclient/settings}. """ - inifiles.X2goIniFile.__init__(self, config_files, defaults=defaults, logger=logger, loglevel=loglevel) + raise X2goNotImplementedYetException('WINREG backend support is not implemented yet') diff --git a/x2go/x2go_exceptions.py b/x2go/x2go_exceptions.py index 9fa8dbd..247c48b 100644 --- a/x2go/x2go_exceptions.py +++ b/x2go/x2go_exceptions.py @@ -54,3 +54,4 @@ class X2goPrintQueueException(_X2goException): pass class X2goPrintActionException(_X2goException): pass class X2goSSHProxyException(_X2goException): pass class X2goSSHProxyAuthenticationException(_X2goException): pass +class X2goNotImplementedYetException(_X2goException): pass 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).