~ubuntu-branches/ubuntu/oneiric/ubuntuone-client/oneiric

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/sync.py

  • Committer: Bazaar Package Importer
  • Author(s): Rodney Dawes
  • Date: 2010-06-08 17:31:18 UTC
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: james.westby@ubuntu.com-20100608173118-o8s897ll11rtne99
Tags: upstream-1.3.0
ImportĀ upstreamĀ versionĀ 1.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
321
321
        if newstat.st_ino != oldstat.st_ino or \
322
322
           newstat.st_size != oldstat.st_size or \
323
323
           newstat.st_mtime != oldstat.st_mtime:
324
 
            m = "The received information is obsolete! New stat: %s"
325
 
            self.log.debug(m, newstat)
 
324
            self.log.debug("The received information is obsolete! New stat: "
 
325
                           "st_ino=%d  st_size=%d  st_mtime=%r",
 
326
                           newstat.st_ino, newstat.st_size, newstat.st_mtime)
326
327
            return False
327
328
        return True
328
329
 
669
670
        """Starts the scan again on a dir."""
670
671
        self.m.lr.scan_dir(self.key['mdid'], self.key['path'], udfmode)
671
672
 
 
673
    def reput_file_from_local(self, event, params, hash):
 
674
        """Re put the file from its local state."""
 
675
        local_hash = self.key['local_hash']
 
676
        previous_hash = self.key['server_hash']
 
677
        crc32 = self.key['crc32']
 
678
        size = self.key['size']
 
679
        share_id = self.key['share_id']
 
680
        node_id = self.key['node_id']
 
681
 
 
682
        self.m.action_q.upload(share_id, node_id, previous_hash, local_hash,
 
683
                               crc32, size, self.key.open_file)
 
684
 
672
685
    def put_file(self, event, params, hash, crc32, size, stat):
673
 
        """upload the file to the server."""
 
686
        """Upload the file to the server."""
674
687
        previous_hash = self.key['server_hash']
675
 
        self.key.set(local_hash=hash, stat=stat)
 
688
        self.key.set(local_hash=hash, stat=stat, crc32=crc32, size=size)
676
689
        self.key.sync()
677
690
 
678
691
        self.m.action_q.upload(share_id=self.key['share_id'],
699
712
 
700
713
 
701
714
    def reput_file(self, event, param, hash, crc32, size, stat):
702
 
        """put the file again."""
 
715
        """Put the file again."""
703
716
        self.m.action_q.cancel_upload(share_id=self.key['share_id'],
704
717
                            node_id=self.key['node_id'])
705
718
        previous_hash = self.key['server_hash']
706
719
 
707
 
        self.key.set(local_hash=hash, stat=stat)
 
720
        self.key.set(local_hash=hash, stat=stat, crc32=crc32, size=size)
708
721
        self.key.sync()
709
722
        self.m.action_q.upload(share_id=self.key['share_id'],
710
723
            node_id=self.key['node_id'], previous_hash=previous_hash,