Exemplo n.º 1
0
     else:
         self.conflictResolution = "keepLocal"
 changes = True
 # summary
 if not self.conflictResolution and not self.onlyMerge:
     self.setStatus(_("Fetching summary from server..."), 0)
     sums = client.summaries()
 if (self.conflictResolution or
     self.onlyMerge or client.needFullSync(sums)):
     self.setStatus(_("Preparing full sync..."), 0)
     if self.conflictResolution == "keepLocal":
         client.remoteTime = 0
     elif self.conflictResolution == "keepRemote" or self.onlyMerge:
         client.localTime = 0
     lastSync = self.deck.lastSync
     ret = client.prepareFullSync()
     if ret[0] == "fromLocal":
         if not self.conflictResolution:
             if lastSync <= 0 and not deckCreated:
                 self.clobberChoice = None
                 self.emit(SIGNAL("syncClobber"), syncName)
                 while not self.clobberChoice:
                     time.sleep(0.2)
                 if self.clobberChoice == "cancel":
                     # disable syncing on this deck
                     c = sqlite.connect(sqlpath)
                     c.execute(
                         "update decks set syncName = null, "
                         "lastSync = 0")
                     c.commit()
                     c.close()