Example #1
0
 def updateState(self, homestate):
     zs = getUtility(IZStorm).get("tilde")
     # Get a local copy for thread safety reasons
     hs = zs.get(HomeState, (homestate.id, homestate.server_name))
     if hs:
         hs.update(homestate)
     else:
         zs.add(HomeState.fromState(homestate))
Example #2
0
 def updateState(self, homestate):
     zs = getUtility(IZStorm).get("tilde")
     # Get a local copy for thread safety reasons
     hs = zs.get(HomeState, (homestate.id, homestate.server_name))
     if hs:
         hs.update(homestate)
     else:
         zs.add(HomeState.fromState(homestate))
Example #3
0
 def _done((newpath, server)):
     ark = server.archive(homestate, newpath)
     ark.addCallback(
         lambda res: self.updateState(
             HomeState.fromState(homestate,
                                 status=HomeState.ARCHIVED,
                                 path=newpath)))
     return ark
Example #4
0
 def _S(self, **k):
     h = HomeState()
     for k, v in k.iteritems():
         setattr(h, k, v)
     self.db.add(h)
     return h
Example #5
0
 def _done((newpath, server)):
     ark = server.archive(homestate, newpath)
     ark.addCallback(lambda res: self.updateState(
         HomeState.fromState(
             homestate, status=HomeState.ARCHIVED, path=newpath)))
     return ark
Example #6
0
 def _done(res):
     return self.updateState(HomeState.fromHome(home))
Example #7
0
 def _done(res):
     d1 = self.updateState(HomeState.fromHome(home))
     d1.addCallback(lambda res: self.refreshState(fromState))
     d1.addCallback(lambda newState: self.remove(newState))
     return d1
Example #8
0
 def _success(res):
     if res:
         return self.updateState(HomeState.fromHome(home))
     else:
         return Failure(Exception("Failed to create home"))
Example #9
0
 def _done(res):
     return self.updateState(HomeState.fromHome(home))
Example #10
0
 def _done(res):
     d1 = self.updateState(HomeState.fromHome(home))
     d1.addCallback(lambda res: self.refreshState(fromState))
     d1.addCallback(lambda newState: self.remove(newState))
     return d1
Example #11
0
 def _success(res):
     if res:
         return self.updateState(HomeState.fromHome(home))
     else:
         return Failure(Exception("Failed to create home"))