From: Jordan Augé Date: Fri, 22 Nov 2013 10:37:28 +0000 (+0100) Subject: added request for metadata calls to be able to handle errors in messages X-Git-Tag: myslice-0.3-0~114 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=1295aaac83bf744acabf41920122837ea2b421d8 added request for metadata calls to be able to handle errors in messages --- diff --git a/manifold/manifoldapi.py b/manifold/manifoldapi.py index 1ffcacee..46229f17 100644 --- a/manifold/manifoldapi.py +++ b/manifold/manifoldapi.py @@ -70,6 +70,8 @@ class ManifoldAPI: } args += (annotations,) result=getattr(self.server, methodName)(*args, **kwds) + print "%s%r" %(methodName, args) + if debug: print '<= result=', self._print_result(result) diff --git a/manifold/metadata.py b/manifold/metadata.py index 4fbbc066..40a88ff6 100644 --- a/manifold/metadata.py +++ b/manifold/metadata.py @@ -4,6 +4,8 @@ import os.path from manifold.manifoldresult import ManifoldResult from manifold.manifoldapi import ManifoldAPI +from django.contrib import messages + debug=False debug=True @@ -17,7 +19,7 @@ class MetaData: self.auth=auth self.hash_by_object={} - def fetch (self): + def fetch (self, request): offline_filename="%s/../offline-metadata.json"%os.path.dirname(__file__) if work_offline: try: diff --git a/unfold/page.py b/unfold/page.py index bc44cd1a..944b2380 100644 --- a/unfold/page.py +++ b/unfold/page.py @@ -130,7 +130,7 @@ class Page: metadata_auth = {'AuthMethod':'anonymous'} metadata=MetaData (metadata_auth) - metadata.fetch() + metadata.fetch(self.request) # store it for next time manifold['metadata']=metadata if debug: print "Page.get_metadata: return new value"