[mirrorbrain-commits] r8077 - in /trunk/mb: mb.py mb/hashes.py

From: <poeml_at_mirrorbrain.org>
Date: Mon, 30 Aug 2010 17:04:23 -0000
Author: poeml
Date: Mon Aug 30 19:04:21 2010
New Revision: 8077

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8077&view=rev
Log:
mb makehashes:
- rename do_zsync flag to do_zsync_hashes, for consistency (internal change)

Modified:
    trunk/mb/mb.py
    trunk/mb/mb/hashes.py

Modified: trunk/mb/mb.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb.py?rev=8077&r1=8076&r2=8077&view=diff
==============================================================================
--- trunk/mb/mb.py (original)
+++ trunk/mb/mb.py Mon Aug 30 19:04:21 2010
_at_@ -1038,7 +1038,7 @@
                                                     src_dir=src_dir, 
                                                     dst_dir=dst_dir,
                                                     base_dir=opts.base_dir,
-                                                    do_zsync=self.config.dbconfig.get('zsync_hashes'))
+                                                    do_zsync_hashes=self.config.dbconfig.get('zsync_hashes'),
                 except OSError, e:
                     if e.errno == errno.ENOENT:
                         sys.stderr.write('File vanished: %r\n' % src)

Modified: trunk/mb/mb/hashes.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mb/mb/hashes.py?rev=8077&r1=8076&r2=8077&view=diff
==============================================================================
--- trunk/mb/mb/hashes.py (original)
+++ trunk/mb/mb/hashes.py Mon Aug 30 19:04:21 2010
_at_@ -31,7 +31,7 @@
 class Hasheable:
     """represent a file and its metadata"""
     def __init__(self, basename, src_dir=None, dst_dir=None,
-                 base_dir=None, do_zsync=False):
+                 base_dir=None, do_zsync_hashes=False):
         self.basename = basename
         if src_dir:
             self.src_dir = src_dir
_at_@ -55,7 +55,7 @@
         self.dst = os.path.join(self.dst_dir, self.dst_basename)
 
         self.hb = HashBag(src=self.src, parent=self)
-        self.hb.do_zsync = do_zsync
+        self.hb.do_zsync_hashes = do_zsync_hashes
 
     def islink(self):
         return stat.S_ISLNK(self.mode)
_at_@ -241,7 +241,7 @@
         self.btih = None
         self.btihhex = None
 
-        self.do_zsync = False
+        self.do_zsync_hashes = False
         self.zsums = []
         self.zblocksize = 0
         self.zseq_matches = None
_at_@ -256,7 +256,7 @@
             sys.stdout.write('Hashing %r... ' % self.src)
             sys.stdout.flush()
 
-        if self.do_zsync:
+        if self.do_zsync_hashes:
             self.zs_guess_zsync_params()
 
         m = md5.md5()
_at_@ -431,7 +431,7 @@
             md4.update(block)
             c = md4.digest()
 
-            if self.do_zsync:
+            if self.do_zsync_hashes:
                 r = zsync.rsum06(block)
 
                 self.zsums.append( r[-self.zrsum_len:] )      # save only some trailing bytes




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Mon Aug 30 2010 - 17:04:25 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT