'Add a directory, and all of its children, to the zip archive.'

def add_dir(self, filename):

    dir_to_strip = (os.path.dirname(filename.rstrip('/')) + '/')
    for (dirpath, dirnames, filenames) in os.walk(filename):
        for f in filenames:
            full_filename = os.path.join(dirpath, f)
            if (not os.path.islink(full_filename)):
                arc_filename = full_filename[len(dir_to_strip):]
                self.z.write(full_filename, arc_filename, zipfile.ZIP_DEFLATED)
                self._size += os.path.getsize(full_filename)
                self.processed_size_callback(self._size)
