Permalink
Browse files

packaged files under the name xzip (E[x]ploded Zip)

- moved relevant file to the xzip package
- added ``*.main()`` methods to the modules so that
  setuptools/distribute can create entry points
- added a simplified ``.gitignore`` for the new layout
  • Loading branch information...
1 parent 2fb34b9 commit 348ead1836c6b0a1e9b14fd792b144864fd71705 @terencehonles committed Apr 24, 2012
Showing with 64 additions and 13 deletions.
  1. +4 −10 .gitignore
  2. +38 −0 setup.py
  3. 0 xzip/__init__.py
  4. +7 −1 {bin → xzip}/analyze.py
  5. +7 −1 {bin → xzip}/explode.py
  6. +8 −1 { → xzip}/fs.py
View
@@ -1,17 +1,11 @@
*.py[oc]
*~
*.swp
-/bin/easy_install
-/bin/easy_install-2.7
-/bin/pip
-/bin/pip-2.7
+/bin
/include
/lib
/lib64
/system
-/bin/activate
-/bin/activate.csh
-/bin/activate.fish
-/bin/activate_this.py
-/bin/python
-/bin/xattr
+/build
+/dist
+/xzip.egg-info
View
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# vim: set fileencoding=utf-8 :
+
+from setuptools import setup, find_packages
+
+setup(
+ name = 'xzip',
+ version = '0.9',
+ packages = find_packages(),
+
+ install_requires = ['fusepy>=1.1'],
+
+ author = 'Terence Honles',
+ author_email = 'terence@honles.com',
+ description = 'E[x]ploded zip file system in FUSE',
+ license = 'PSF',
+ keywords = 'FS FileSystem File System Zip Deduplication',
+
+ entry_points = {
+ 'console_scripts': [
+ 'zipexplode = xzip.explode:main',
+ 'zipanaylze = xzip.anaylze:main',
+ 'mount.xzip = xzip.fs:main',
+ ],
+ },
+
+ classifiers = [
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Console',
+ 'Intended Audience :: Information Technology',
+ 'Intended Audience :: System Administrators',
+ 'License :: OSI Approved :: Python Software Foundation License',
+ 'Operating System :: MacOS',
+ 'Operating System :: POSIX',
+ 'Operating System :: Unix',
+ 'Topic :: System :: Filesystems',
+ ]
+)
View
No changes.
@@ -9,6 +9,9 @@
from collections import namedtuple
from hashlib import sha1
+__all__ = ('CENTRAL_DIR', 'END_OF_DIR', 'LOCAL_HEADER', 'DATA_DESCRIPTOR',
+ 'process_zip')
+
class _Struct(struct.Struct):
__slots__ = ('marker', '_named_ctor')
@@ -118,5 +121,8 @@ def process_file(file, info):
sha1(decompressed).hexdigest())
-if __name__ == '__main__':
+def main():
process_zip(sys.argv[1])
+
+if __name__ == '__main__':
+ main()
@@ -11,6 +11,8 @@
from hashlib import sha1
from os import path
+__all__ = ('CENTRAL_DIR', 'END_OF_DIR', 'LOCAL_HEADER', 'DATA_DESCRIPTOR',
+ 'STREAM_ITEM', 'JUMP_ITEM', 'parser', 'process_zip', 'process_file')
class _Struct(struct.Struct):
__slots__ = ('marker', '_named_ctor')
@@ -164,8 +166,12 @@ def process_file(file, info, stream, depth=0, base='.'):
parser.add_argument('filenames', metavar='FILE', nargs='+',
help='zip files to process')
-if __name__ == '__main__':
+
+def main():
args = parser.parse_args()
for filename in args.filenames:
process_zip(filename, depth=args.depth, base=args.directory)
+
+if __name__ == '__main__':
+ main()
View
@@ -16,6 +16,10 @@
from os import path
from struct import Struct
+__all__ = ('ZIP_STREAM_ITEM', 'DESCRIPTOR', 'STREAM_ITEM', 'JUMP_ITEM',
+ 'HEADER_DIFF', 'Descriptor', 'ExplodedInfo', 'ExplodedZip', 'File',
+ 'StreamItem', 'SeekTree', 'parser')
+
ZIP_STREAM_ITEM = Struct('<4s5H3L2H')
DESCRIPTOR = Struct('<3L')
STREAM_ITEM = Struct('<4s5H3L2HB20s')
@@ -594,9 +598,12 @@ def writeable(self):
parser.add_argument('mount', help='mount point')
-if __name__ == '__main__':
+def main():
args = parser.parse_args()
fuse = FUSE(ExplodedZip(base=args.directory, depth=args.depth),
args.mount, foreground=not args.background, ro=True,
debug=args.debug, nothreads=args.single_threaded)
+
+if __name__ == '__main__':
+ main()

0 comments on commit 348ead1

Please sign in to comment.