Permalink
Browse files

adding README and making sure package works in Py3k

  • Loading branch information...
1 parent 348ead1 commit 4bcb2d8a89a72f11717ed3e34211ce3c444e940e @terencehonles committed Apr 24, 2012
Showing with 82 additions and 1 deletion.
  1. +1 −0 README
  2. +57 −0 README.rst
  3. +22 −0 setup.py
  4. +2 −1 xzip/fs.py
View
View
@@ -0,0 +1,57 @@
+E[x]ploded Zip File System
+==========================
+
+``xzip`` is a FUSE_ file system for deduplicating zip files which share zipped
+contents.
+
+To install use::
+
+ $ pip install xzip
+
+ or
+
+ $ easy_install xzip
+
+``xzip`` provides three executables ``zipexplode``, ``zipanalyze``, and
+``mount.xzip`` which will "explode" a zip, analyze a zip file, and mount
+exploded zips respectively.
+
+The file structure for an exploded zip is the following::
+
+ $ zipexplode path/to/zip/name-of-zip.zip
+ $ tree .
+ .
+ ├── data
+ │   ├── <sha1-data-file1>
+ │   ├── <sha1-data-file2>
+ │   ├── ...
+ │   └── <sha1-data-filen>
+ └── meta
+    ├── name-of-zip.zip.dir
+    ├── name-of-zip.zip.jump
+    └── name-of-zip.zip.stream
+
+
+Data files may be shared between an arbitrary number of exploded zips files,
+and the meta tuple (``*.dir``, ``*.jump``, ``*.stream``) describe the original
+zip file.
+
+
+``zipexplode`` accepts two options ``--directory`` and ``--depth`` to modify
+where it creates the ``data`` and ``meta`` directories and how many levels deep
+the ``data`` directory should be. ``zipexplode`` can explode multiple zip files
+at once, and additional help is provided with the ``--help`` option.
+
+
+``zipanalyze`` simply prints out the sha1 of different segments of the original
+zip file. This script was used to determine what could be deduplicated, and
+what needed to be stored per zip file. This executable is mainly of historical
+use.
+
+``mount.xzip`` will mount the directory structure described above, and needs to
+be supplied with matching ``--directory`` and ``--depth`` arguments to when
+``zipexplode`` was called. Additional arguments ``--debug``, ``--background``,
+and ``--single-threaded`` which are passed to FUSE_ and control underlying
+functionality. For more information see the ``--help`` for ``mount.xzip``.
+
+.. _FUSE: http://fuse.sourceforge.net/
View
@@ -3,6 +3,15 @@
from setuptools import setup, find_packages
+try:
+ from lib2to3 import refactor
+ fixers = set(refactor.get_fixers_from_package('lib2to3.fixes'))
+except ImportError:
+ fixers = set()
+
+with open('README') as readme:
+ documentation = readme.read()
+
setup(
name = 'xzip',
version = '0.9',
@@ -13,6 +22,7 @@
author = 'Terence Honles',
author_email = 'terence@honles.com',
description = 'E[x]ploded zip file system in FUSE',
+ long_description = documentation,
license = 'PSF',
keywords = 'FS FileSystem File System Zip Deduplication',
@@ -24,6 +34,16 @@
],
},
+
+ use_2to3 = True,
+ # only use the following fixers (everything else is already compatible)
+ use_2to3_exclude_fixers = fixers - set([
+ 'lib2to3.fixes.fix_except',
+ 'lib2to3.fixes.fix_future',
+ 'lib2to3.fixes.fix_numliterals',
+ 'lib2to3.fixes.fix_reduce',
+ ]),
+
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
@@ -33,6 +53,8 @@
'Operating System :: MacOS',
'Operating System :: POSIX',
'Operating System :: Unix',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
'Topic :: System :: Filesystems',
]
)
View
@@ -344,7 +344,8 @@ def _load_stream_item(self):
header = StreamItem._make(STREAM_ITEM.unpack(raw_header))
var_fields = header.filename_len + header.extra_field_len
- sha1 = b2a_hex(header.sha)
+ # I would think that b2a_hex should decode the raw bytes...
+ sha1 = b2a_hex(header.sha).decode('ascii')
# only save the zip part of the header
self.zip_header = (raw_header[:HEADER_DIFF] +

0 comments on commit 4bcb2d8

Please sign in to comment.