#!/usr/bin/env python import sha import os import socket # This file is originally stolen from pypod-0.5.0 # http://superduper.net/index.py?page=pypod # I hope that's ok, both works are GPL. hostname = socket.gethostname() class ParseError(Exception): pass class SyncError(Exception): pass def sha1_hash(filename): import struct # only hash the first 16k hash_len = 4*4096 hash = sha.sha() size = os.path.getsize(filename) hash.update(struct.pack("