Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2013-06-02 08:41:16 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2013-06-02 08:41:16 (GMT)
commit4cf7d7e30318d85f5371b86f5b2142d581c254c5 (patch)
tree06fcb2eb6d6fb203bb85a53557d22f1ff0ab7a5c
parentd1fdc48085e63202c0c4a6a4005bd41b9e0ac90f (diff)
Do not pass context title via 0install to avoid loosing unicode chars
-rw-r--r--sugar_network/client/injector.py2
-rw-r--r--sugar_network/client/solver.py10
2 files changed, 7 insertions, 5 deletions
diff --git a/sugar_network/client/injector.py b/sugar_network/client/injector.py
index 2a8f61e..ec1c1e6 100644
--- a/sugar_network/client/injector.py
+++ b/sugar_network/client/injector.py
@@ -221,7 +221,7 @@ def _activity_env(impl, environ):
])
environ['SUGAR_BUNDLE_PATH'] = impl_path
environ['SUGAR_BUNDLE_ID'] = impl['context']
- environ['SUGAR_BUNDLE_NAME'] = impl['name']
+ environ['SUGAR_BUNDLE_NAME'] = impl['name'].encode('utf8')
environ['SUGAR_BUNDLE_VERSION'] = impl['version']
environ['SUGAR_ACTIVITY_ROOT'] = root
environ['PYTHONPATH'] = impl_path + ':' + environ.get('PYTHONPATH', '')
diff --git a/sugar_network/client/solver.py b/sugar_network/client/solver.py
index f262717..cf3da34 100644
--- a/sugar_network/client/solver.py
+++ b/sugar_network/client/solver.py
@@ -153,7 +153,7 @@ def _impl_new(config, iface, sel):
impl = {'id': sel.id,
'context': iface,
'version': sel.version,
- 'name': feed.name,
+ 'name': feed.title,
'stability': sel.impl.upstream_stability.name,
}
if isabs(sel.id):
@@ -182,7 +182,7 @@ def _load_feed(conn, context):
host_versin = '.'.join(config.version.split('.', 2)[:2])
for version in SUGAR_API_COMPATIBILITY.get(host_versin) or []:
feed.implement_sugar(version)
- feed.name = context
+ feed.name = feed.name = context
return feed
except ImportError:
pass
@@ -201,8 +201,9 @@ def _load_feed(conn, context):
pipe.trace('No feeds for %s', context)
return None
- # XXX 0install fails on non-ascii name
- feed.name = feed_content['name'].encode('ascii', 'backslashreplace')
+ # XXX 0install fails on non-ascii `name` values
+ feed.name = context
+ feed.title = feed_content['name']
feed.to_resolve = feed_content.get('packages')
if not feed.to_resolve:
pipe.trace('No compatible packages for %s', context)
@@ -227,6 +228,7 @@ class _Feed(model.ZeroInstallFeed):
self.last_checked = None
self.to_resolve = None
self._package_implementations = []
+ self.title = None
@property
def url(self):