コード例 #1
0
ファイル: verify.py プロジェクト: mbr/remand
    def verify_file(self, st, local_path, remote_path):
        # hash local file
        with open(local_path, 'rb') as lfile:
            m = util.hash_file(lfile, self.hashfunc)

        remote_hash = self._get_remote_hash(remote_path)
        log.debug('Local hash: {} Remote hash: {}'.format(
            m.hexdigest(), remote_hash))

        return remote_hash == m.hexdigest()
コード例 #2
0
ファイル: verify.py プロジェクト: mbr/remand
    def verify_file(self, st, local_path, remote_path):
        # hash local file
        with open(local_path, 'rb') as lfile:
            m = util.hash_file(lfile, self.hashfunc)

        remote_hash = self._get_remote_hash(remote_path)
        log.debug('Local hash: {} Remote hash: {}'.format(
            m.hexdigest(), remote_hash))

        return remote_hash == m.hexdigest()
コード例 #3
0
 def _get_hash(self):
     with self.open('rb') as f:
         return util.hash_file(f)