Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2012-08-16 13:32:10 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2012-08-16 13:32:10 (GMT)
commit6e73d57ce45f6651ae6134948cf80a41a6d20832 (patch)
treea3b3d12c14d9dc6fe737d8e8df6808107c268038
parent887a3011a17ee44b94a88c6e15dfc5e0259215ac (diff)
Comment out processing deps; add requires command to get deps to install them manually, eg, during image building
-rwxr-xr-xsugar-network-service21
-rw-r--r--sugar_network/local/mountset.py20
-rw-r--r--sugar_network/zerosugar/feeds.py7
3 files changed, 42 insertions, 6 deletions
diff --git a/sugar-network-service b/sugar-network-service
index 4fe474b..7bb8d23 100755
--- a/sugar-network-service
+++ b/sugar-network-service
@@ -137,7 +137,14 @@ class Application(application.Application):
@application.command(hidden=True)
def GET(self):
result = self._call('GET', None)
- print json.dumps(result, indent=2)
+
+ if type(result) in (list, set, tuple):
+ for i in result:
+ print i
+ elif type(result) is dict:
+ print json.dumps(result, indent=2)
+ else:
+ print result
@application.command(
'start service and log to standard output')
@@ -209,9 +216,10 @@ class Application(application.Application):
try:
mountset.open()
jobs.spawn(IPCServer(mountset).serve_forever)
- if not minimal:
+ if minimal:
+ jobs.join()
+ else:
dbus_thread.start(mountset)
- jobs.join()
except KeyboardInterrupt:
util.exception('%s interrupted', self.name)
except Exception:
@@ -267,7 +275,12 @@ class Application(application.Application):
arg, value = pair.split('=', 1)
arg = arg.strip()
enforce(arg, 'No argument name in %r expression', arg)
- kwargs[arg] = value
+ if arg in kwargs:
+ if isinstance(kwargs[arg], basestring):
+ kwargs[arg] = [kwargs[arg]]
+ kwargs[arg].append(value)
+ else:
+ kwargs[arg] = value
with self._rendezvous():
return Client.call(method, content=content, **kwargs)
diff --git a/sugar_network/local/mountset.py b/sugar_network/local/mountset.py
index f81476b..721c217 100644
--- a/sugar_network/local/mountset.py
+++ b/sugar_network/local/mountset.py
@@ -114,6 +114,26 @@ class Mountset(dict, ad.CommandsProcessor, SyncCommands):
content={'keep': True}),
ad.Response())
+ @ad.volume_command(method='GET', cmd='requires')
+ def requires(self, mountpoint, context):
+ mount = self.get(mountpoint)
+ enforce(mount is not None, 'No such mountpoint')
+ mount.mounted.wait()
+
+ requires = set()
+
+ for guid in [context] if isinstance(context, basestring) else context:
+ feed = mount.call(
+ ad.Request(method='GET', document='context', guid=guid,
+ prop='feed', accept_language=[self._locale]),
+ ad.Response())
+ for impls in feed.values():
+ for impl in impls.values():
+ if 'requires' in impl:
+ requires.update(impl['requires'].keys())
+
+ return list(requires)
+
@ad.volume_command(method='POST', cmd='publish')
def republish(self, request):
self.publish(request.content)
diff --git a/sugar_network/zerosugar/feeds.py b/sugar_network/zerosugar/feeds.py
index e496d9c..26a4eb8 100644
--- a/sugar_network/zerosugar/feeds.py
+++ b/sugar_network/zerosugar/feeds.py
@@ -58,7 +58,8 @@ def read(context):
impl.arch = arch
impl.upstream_stability = \
model.stability_levels[impl_data['stability']]
- impl.requires.extend(_read_requires(impl_data.get('requires')))
+ # TODO
+ #impl.requires.extend(_read_requires(impl_data.get('requires')))
if isabs(impl_id):
impl.local_path = impl_id
@@ -169,7 +170,9 @@ class _Command(model.Command):
self.qdom = None
self.name = name
self._path = data['exec']
- self._requires = _read_requires(data.get('requires'))
+ # TODO
+ #self._requires = _read_requires(data.get('requires'))
+ self._requires = []
@property
def path(self):