Jonas Borgström пре 15 година
родитељ
комит
357cad4d5d
4 измењених фајлова са 7 додато и 7 уклоњено
  1. 3 3
      dedupestore/archiver.py
  2. 2 2
      dedupestore/cache.py
  3. 1 1
      dedupestore/chunkifier.py
  4. 1 1
      setup.py

+ 3 - 3
dedupestore/archiver.py

@@ -27,7 +27,7 @@ class Archive(object):
             self.chunks.append((id, sum, csize, osize))
             self.chunk_idx[id] = idx
             return idx
-        
+
     def open(self, name):
         archive = cPickle.loads(zlib.decompress(self.store.get(NS_ARCHIVES, name)))
         self.items = archive['items']
@@ -93,9 +93,11 @@ class Archive(object):
             for root, dirs, files in os.walk(path):
                 for d in dirs:
                     p = os.path.join(root, d)
+                    print p
                     self.items.append(self.process_dir(p, cache))
                 for f in files:
                     p = os.path.join(root, f)
+                    print p
                     self.items.append(self.process_file(p, cache))
         self.save(name)
         cache.archives.append(name)
@@ -103,13 +105,11 @@ class Archive(object):
 
     def process_dir(self, path, cache):
         path = path.lstrip('/\\:')
-        print 'Directory: %s' % (path)
         return {'type': 'DIR', 'path': path}
 
     def process_file(self, path, cache):
         with open(path, 'rb') as fd:
             path = path.lstrip('/\\:')
-            print 'Adding: %s...' % path
             chunks = []
             for chunk in chunkify(fd, CHUNK_SIZE, cache.summap):
                 chunks.append(self.add_chunk(*cache.add_chunk(chunk)))

+ 2 - 2
dedupestore/cache.py

@@ -58,7 +58,7 @@ class Cache(object):
     def save(self):
         assert self.store.state == Store.OPEN
         print 'saving cache'
-        data = {'uuid': self.store.uuid, 
+        data = {'uuid': self.store.uuid,
                 'chunkmap': self.chunkmap, 'summap': self.summap,
                 'tid': self.store.tid, 'archives': self.archives}
         print 'Saving cache as:', self.path
@@ -96,7 +96,7 @@ class Cache(object):
 
     def chunk_decref(self, id):
         count, sum, csize, osize = self.chunkmap[id]
-        sumcount = self.summap[sum] 
+        sumcount = self.summap[sum]
         if sumcount == 1:
             del self.summap[sum]
         else:

+ 1 - 1
dedupestore/chunkifier.py

@@ -1,6 +1,6 @@
 def checksum(data, sum=0):
     """Simple but fast checksum that can be updated at either end.
-    
+
     >>> checksum('FOOBAR')
     102367679
     >>> checksum('FOOBAR') == checksum('BAR', checksum('FOO'))

+ 1 - 1
setup.py

@@ -10,4 +10,4 @@ setup(name='Dedupestore',
       packages=['dedupestore'],
       ext_modules=[Extension('_speedups', ['dedupestore/_speedups.c'])],
      )
-    
+