[ARVADOS] updated: 444af0ae1f9b9d36af72e57ae508cd0608988236

git at public.curoverse.com git at public.curoverse.com
Mon Feb 17 13:50:38 EST 2014


Summary of changes:
 sdk/python/arvados/keep.py |    7 ++++---
 sdk/python/bin/arv-ls      |    9 +++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

       via  444af0ae1f9b9d36af72e57ae508cd0608988236 (commit)
       via  89a9429f8fe9248320fad181afe972e144d10669 (commit)
      from  0b0f8c5211ee93d2fd2bceb2a4331a06cea52663 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 444af0ae1f9b9d36af72e57ae508cd0608988236
Author: Peter Amstutz <peter.amstutz at clinicalfuture.com>
Date:   Mon Feb 17 18:50:32 2014 +0000

    added -s option

diff --git a/sdk/python/bin/arv-ls b/sdk/python/bin/arv-ls
index c96f4cf..b2fe02d 100755
--- a/sdk/python/bin/arv-ls
+++ b/sdk/python/bin/arv-ls
@@ -18,6 +18,8 @@ parser.add_argument('locator', type=str,
 Collection locator, optionally with a file path or prefix.
 """)
 
+parser.add_argument('-s', action='store_true', help="""List file sizes, in KiB.""")
+
 args = parser.parse_args()
 
 import arvados
@@ -25,4 +27,7 @@ import arvados
 cr = arvados.CollectionReader(arvados.Keep.get(args.locator))
 
 for f in cr.all_files():
-    print(f.stream_name() + "/" + f.name())
+    if args.s:
+        print "{:>10} {}".format(f.size() / 1024, f.stream_name() + "/" + f.name())
+    else:
+        print f.stream_name() + "/" + f.name()

commit 89a9429f8fe9248320fad181afe972e144d10669
Author: Peter Amstutz <peter.amstutz at clinicalfuture.com>
Date:   Mon Feb 17 18:41:51 2014 +0000

    implemented arv-ls to replace whls

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 38dddbe..5f9a6d9 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -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."""
diff --git a/sdk/python/bin/arv-ls b/sdk/python/bin/arv-ls
index f30145a..c96f4cf 100755
--- a/sdk/python/bin/arv-ls
+++ b/sdk/python/bin/arv-ls
@@ -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())

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list