implemented arv-ls to replace whls
authorPeter Amstutz <peter.amstutz@clinicalfuture.com>
Mon, 17 Feb 2014 18:41:51 +0000 (18:41 +0000)
committerPeter Amstutz <peter.amstutz@clinicalfuture.com>
Mon, 17 Feb 2014 18:41:51 +0000 (18:41 +0000)
sdk/python/arvados/keep.py
sdk/python/bin/arv-ls

index 38dddbe22b234979afdfe8c2e399e7cc45ea0b63..5f9a6d916b7839f17e1d3e76a9dd43b3a4c5b1fe 100644 (file)
@@ -250,18 +250,19 @@ class KeepClient(object):
         """Put a block into the cache."""
         if self.check_cache(locator) != None:
             return
-        self.cache_lock.acquire()
+        self._cache_lock.acquire()
         try:
             # first check cache size and delete stuff from the end if necessary
             sm = sum([len(a[1]) for a in self._cache]) + len(data)
-            while sum > self._cache_max:
+            while sm > self._cache_max:
+               print sm, self._cache_max
                 del self._cache[-1]
                 sm = sum([len(a[1]) for a in self._cache]) + len(data)
 
             # now add the new block at the front of the list
             self._cache.insert(0, [locator, data])
         finally:
-            self.cache_lock.release()
+            self._cache_lock.release()
 
     def check_cache(self, locator):
         """Get a block from the cache.  Also moves the block to the front of the list."""
index f30145af54d00e522eaf5ea90c4dc82bce70a8df..c96f4cfa552f4ac039787f9152d596908a3f58ac 100755 (executable)
@@ -24,5 +24,5 @@ import arvados
 
 cr = arvados.CollectionReader(arvados.Keep.get(args.locator))
 
-for f in rc.all_files():
+for f in cr.all_files():
     print(f.stream_name() + "/" + f.name())