diff options
author | James Cameron <quozl@laptop.org> | 2010-07-27 01:26:56 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2010-08-13 07:27:15 (GMT) |
commit | 4a3416b9acdfdd533ee2d69633f1383476db5e71 (patch) | |
tree | a03df9fb10c0e1875dba09e434b7c894390b9a6b /src/jarabe/desktop | |
parent | fbd1f1e7f30d30d754bea9d1e61132176a7f6ae4 (diff) |
restore sugar-launch by bundle id substring, fixes #897
sugar-launch uses GetBundlePath which calls bundleregistry.get_bundle().
In this patch, the get_bundle() method is changed to retain as much of
the original API as possible, yet in the situation where it might return
None it will now return a bundle if there is only one bundle that
matches the search string.
http://bugs.sugarlabs.org/ticket/897
http://dev.laptop.org/ticket/9189
Patch tested on Sugar 0.84.10 on OLPC XO-1.5 build os108.
Test case:
import jarabe.model.bundleregistry
registry = jarabe.model.bundleregistry.BundleRegistry()
tests = ['org.laptop.Terminal', 'Terminal', 'terminal', 'e', 'asdqweas']
for x in tests:
y = registry.get_bundle(x)
if y is None:
z = 'None'
else:
z = y.get_bundle_id()
print x, z
Output before patch:
org.laptop.Terminal org.laptop.Terminal
Terminal None
terminal None
e None
asdqweas None
Output after patch:
org.laptop.Terminal org.laptop.Terminal
Terminal org.laptop.Terminal
terminal org.laptop.Terminal
e None
asdqweas None
Diffstat (limited to 'src/jarabe/desktop')
0 files changed, 0 insertions, 0 deletions