Exemplo n.º 1
0
 def Get(self):
     commit_tracker = self._delegate.CreateCommitTracker()
     commit_name, commit_id = self._request.path.split('/', 1)
     history = commit_tracker.GetHistory(commit_name).Get()
     if not any(entry.commit_id == commit_id for entry in history):
         return Response.BadRequest('Commit %s not cached.' % commit_id)
     commit_tracker.Set(commit_name, commit_id).Get()
     return Response.Ok('Commit "%s" updated to %s' %
                        (commit_name, commit_id))
Exemplo n.º 2
0
 def Get(self):
     if not IsDevServer():
         return Response.BadRequest('')
     import cPickle
     from persistent_object_store_appengine import PersistentObjectStoreAppengine
     with open(self._request.path, 'r') as f:
         data = cPickle.load(f)
     for namespace, contents in data.iteritems():
         store = PersistentObjectStoreAppengine(namespace)
         for k, v in cPickle.loads(contents).iteritems():
             try:
                 store.Set(k, v).Get()
             except:
                 logging.warn('Skipping entry %s because of errors.' % k)
     return Response.Ok('Data pushed!')