]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
pyfec: fix up docs, version numbers, bump version to 1.0.0a1-0-STABLE
authorZooko O'Whielacronx <zooko@zooko.com>
Sat, 14 Apr 2007 19:54:51 +0000 (12:54 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Sat, 14 Apr 2007 19:54:51 +0000 (12:54 -0700)
pyfec/README.txt
pyfec/bin/fec
pyfec/bin/unfec
pyfec/fec/__init__.py
pyfec/setup.py

index fc108a87262b1fe829e00c61c59063853712f2ed..b8f70e1d3af0d59e506f29b700e14ae568d4953a 100644 (file)
@@ -18,8 +18,8 @@ This package is largely based on the old "fec" library by Luigi Rizzo et al.,
 which is a mature and optimized implementation of erasure coding.  The pyfec
 package makes several changes from the original "fec" package, including
 addition of the Python API, refactoring of the C API to support zero-copy
-operation, and a few clean-ups and micro-optimizations of the core code
-itself.
+operation, a few clean-ups and micro-optimizations of the core code itself, 
+and the addition of a command-line tool named "fec".
 
 
  * Community
@@ -73,6 +73,19 @@ encoding step.  The decoding step produces as output the data that was earlier
 input to the encoding step.
 
 
+ * Command-Line Tool
+
+The bin/ directory contains two Unix-style, command-line tools "fec" and 
+"unfec".  Execute "fec --help" or "unfec --help" for usage instructions.
+
+Note: a Unix-style tool like "fec" does only one thing -- in this case erasure 
+coding -- and leaves other tasks to other tools.  Other Unix-style tools that 
+go well with "fec" include "GNU tar" for packaging up multiple files and 
+directories into one bundle, "rzip" for compression, and "GNU Privacy Guard" 
+for encryption.  It is best to do things in that order: first package, then 
+compress, then encrypt, then erasure code.
+
+
  * API
 
 Each block is associated with "blocknum".  The blocknum of each primary block is
@@ -80,7 +93,7 @@ its index (starting from zero), so the 0'th block is the first primary block,
 which is the first few bytes of the file, the 1'st block is the next primary
 block, which is the next few bytes of the file, and so on.  The last primary
 block has blocknum k-1.  The blocknum of each secondary block is an arbitrary
-integer between k and 256 inclusive.  (When using the Python API, if you don't
+integer between k and 255 inclusive.  (When using the Python API, if you don't
 specify which blocknums you want for your secondary blocks when invoking
 encode(), then it will by default provide the blocks with ids from k to m-1
 inclusive.)
@@ -147,9 +160,6 @@ objects (e.g. Python strings) to hold the data that you pass to pyfec.
 The filefec.py module which has a utility function for efficiently reading a
 file and encoding it piece by piece.
 
-The bin/ directory contains two Unix-style, command-line tools "fec" and 
-"unfec".  See their usage strings for details.
-
 
  * Dependencies
 
index 170933ce231a1dbe3bedd3eaedd3355eda6eee08..4b29862fa93ac7128fa952f85c297c15f4908d92 100644 (file)
@@ -5,10 +5,17 @@
 
 import sys
 
+import fec
 from fec.util import argparse
-
 from fec import filefec
-
+from fec.util.version import Version
+__version__ = Version("1.0.0a1-0-STABLE")
+
+if '-V' in sys.argv or '--version' in sys.argv:
+    print "pyfec library version: ", fec.__version__
+    print "fec command-line tool version: ", __version__
+    sys.exit(0)
+  
 parser = argparse.ArgumentParser(description="Encode a file into a set of share files, a subset of which can later be used to recover the original file.")
 
 parser.add_argument('inputfile', help='file to encode or "-" for stdin', type=argparse.FileType('rb'), metavar='INF')
@@ -18,6 +25,7 @@ parser.add_argument('-s', '--suffix', help='suffix for share file names', defaul
 parser.add_argument('-m', '--totalshares', help='the total number of share files created', default=16, metavar='M')
 parser.add_argument('-k', '--requiredshares', help='the number of share files required to reconstruct', default=4, metavar='K')
 parser.add_argument('-v', '--verbose', help='print out messages about progress', action='store_true')
+parser.add_argument('-V', '--version', help='print out version number and exit', action='store_true')
 args = parser.parse_args()
 
 if args.prefix is None:
index 15a87ae04f311446fbe6b40dfb8b3897e5e02389..8ef5c1fb2a346dc8f2caf05e3e2ab1abcaaba739 100644 (file)
@@ -7,13 +7,22 @@ import sys
 
 from fec.util import argparse
 
+import fec
 from fec import filefec
-
+from fec.util.version import Version
+__version__ = Version("1.0.0a1-0-STABLE")
+
+if '-V' in sys.argv or '--version' in sys.argv:
+    print "pyfec library version: ", fec.__version__
+    print "fec command-line tool version: ", __version__
+    sys.exit(0)
+  
 parser = argparse.ArgumentParser(description="Decode data from share files.")
 
 parser.add_argument('outputfile', help='file to write the resulting data to, or "-" for stdout', type=argparse.FileType('wb'), metavar='OUTF')
 parser.add_argument('sharefiles', nargs='+', help='shares file to read the encoded data from', type=argparse.FileType('rb'), metavar='SHAREFILE')
 parser.add_argument('-v', '--verbose', help='print out messages about progress', action='store_true')
+parser.add_argument('-V', '--version', help='print out version number and exit', action='store_true')
 args = parser.parse_args()
 
 if len(args.sharefiles) < 2:
index 1e3baaf3703c205c14696f2298c3f201babdd6fb..ddae766c7ffe9fdfef51883808aeda1c0ba9fba8 100644 (file)
@@ -10,7 +10,7 @@ from util.version import Version
 
 # For an explanation of what the parts of the version string mean,
 # please see pyutil.version.
-__version__ = Version("0.9.9-0-STABLE")
+__version__ = Version("1.0.0a1-0-STABLE")
 
 # Please put a URL or other note here which shows where to get the branch of
 # development from which this version grew.
index 3081ef6437c38c747443bfe5b4867b04cada15ee..bd1321f7e1af9de33d97ae17100c53b33090372d 100644 (file)
@@ -55,12 +55,12 @@ trove_classifiers=[
     ]
 
 setup(name='pyfec',
-      version='0.99',
+      version='1.0.0a1',
       summary='Provides a fast C implementation of Reed-Solomon erasure coding with a Python interface.',
-      description='Erasure coding is the generation of extra redundant packets of information such that if some packets are lost ("erased") then the original data can be recovered from the remaining packets.  This package contains an optimized implementation along with a Python interface.',
+      description='Erasure coding is the generation of redundant blocks of information such that if some blocks are lost ("erased") then the original data can be recovered from the remaining blocks.  This package contains an optimized implementation along with a Python interface.',
       author='Zooko O\'Whielacronx',
       author_email='zooko@zooko.com',
-      url='http://zooko.com/repos/pyfec',
+      url='http://www.allmydata.com/source/pyfec',
       license='GNU GPL',
       platform='Any',
       packages=['fec', 'fec.util', 'fec.test'],