[X2Go-Commits] [python-x2go] 04/05: Make session profile backends more unicode robust.
git-admin at x2go.org
git-admin at x2go.org
Mon Mar 10 16:08:47 CET 2014
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch brokerclient
in repository python-x2go.
commit 921fa74fdd6c70c12de8110d4a2652ff4b215431
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Mar 10 16:03:11 2014 +0100
Make session profile backends more unicode robust.
---
debian/changelog | 1 +
x2go/backends/profiles/base.py | 18 ++++++++++--------
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 3d245b2..3d7ff02 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ python-x2go (0.5.0.0-0x2go1) UNRELEASED; urgency=low
- Fix setting default values in X2GoClientXConfig class.
- Default to xdg-open as default PDF viewer command.
- Provide basic session profile backend for a http broker.
+ - Make session profile backends more unicode robust.
-- Mike Gabriel <mike.gabriel at das-netzwerkteam.de> Sun, 05 Jan 2014 16:35:57 +0100
diff --git a/x2go/backends/profiles/base.py b/x2go/backends/profiles/base.py
index 7660165..541e521 100644
--- a/x2go/backends/profiles/base.py
+++ b/x2go/backends/profiles/base.py
@@ -153,7 +153,7 @@ class X2GoSessionProfiles():
_metatype = 'RDP/direct'
else:
_metatype = 'not supported'
- self._profile_metatypes[_profile_id] = _metatype
+ self._profile_metatypes[_profile_id] = unicode(_metatype)
else:
return self._profile_metatypes[_profile_id]
@@ -240,7 +240,7 @@ class X2GoSessionProfiles():
_export_path = ':'.join(_path.split(':')[:-1])
value[_export_path] = _auto_export_path
- return value
+ return unicode(value)
else:
raise X2GoProfileException('no such session profile parameter: %s' % parameter)
@@ -305,7 +305,7 @@ class X2GoSessionProfiles():
@rtype: C{bool}
"""
- return profile_id in self.profile_ids
+ return unicode(profile_id) in self.profile_ids
@property
def profile_names(self):
@@ -328,7 +328,7 @@ class X2GoSessionProfiles():
@rtype: C{bool}
"""
- return profile_name in self.profile_names
+ return unicode(profile_name) in self.profile_names
def to_profile_id(self, profile_name):
"""\
@@ -343,7 +343,7 @@ class X2GoSessionProfiles():
"""
_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]
+ return unicode(_profile_ids[0])
elif len(_profile_ids) == 0:
return None
else:
@@ -362,9 +362,9 @@ class X2GoSessionProfiles():
"""
_profile_config = self.get_profile_config(profile_id=profile_id)
if _profile_config.has_key('name'):
- return _profile_config['name']
+ return unicode(_profile_config['name'])
else:
- return ''
+ return u''
def add_profile(self, profile_id=None, force_add=False, **kwargs):
"""\
@@ -398,7 +398,7 @@ class X2GoSessionProfiles():
self._cached_profile_ids = []
self._cached_profile_names = []
- return profile_id
+ return unicode(profile_id)
def delete_profile(self, profile_id_or_name):
"""\
@@ -497,6 +497,8 @@ class X2GoSessionProfiles():
_profile_id = profile_id_or_name
else:
raise X2GoProfileException('No session profile with id or name ,,%s\'\' exists.' % profile_id_or_name)
+ if _profile_id is not None:
+ _profile_id = unicode(_profile_id)
return _profile_id
def to_session_params(self, profile_id_or_name=None, profile_id=None):
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git
More information about the x2go-commits
mailing list