[ARVADOS] updated: 8077e894a1f48e526c05ccf5cff22cfaae85ba69
git at public.curoverse.com
git at public.curoverse.com
Thu Jan 16 08:59:09 EST 2014
Summary of changes:
sdk/python/arvados/__init__.py | 13 ++++++-------
sdk/python/bin/arv-get | 2 --
2 files changed, 6 insertions(+), 9 deletions(-)
via 8077e894a1f48e526c05ccf5cff22cfaae85ba69 (commit)
via bffcd382046785464c01b67a68ae56a786d74e82 (commit)
from 89d46fe3c760785315ed1f53087e7aa2368f6f30 (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 8077e894a1f48e526c05ccf5cff22cfaae85ba69
Merge: bffcd38 89d46fe
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Jan 16 08:59:42 2014 -0500
Merge branch 'master' of git.clinicalfuture.com:arvados
commit bffcd382046785464c01b67a68ae56a786d74e82
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Jan 16 08:59:12 2014 -0500
Fixed Python SDK to quote/unquote spaces when reading/writing manifests. Refs #1849
diff --git a/sdk/python/arvados/__init__.py b/sdk/python/arvados/__init__.py
index ca91963..406d3ed 100644
--- a/sdk/python/arvados/__init__.py
+++ b/sdk/python/arvados/__init__.py
@@ -603,12 +603,12 @@ class StreamReader(object):
for tok in self._tokens:
if self._stream_name == None:
- self._stream_name = tok
+ self._stream_name = tok.replace('\\040', ' ')
elif re.search(r'^[0-9a-f]{32}(\+\S+)*$', tok):
self.data_locators += [tok]
elif re.search(r'^\d+:\d+:\S+', tok):
pos, size, name = tok.split(':',2)
- self.files += [[int(pos), int(size), name]]
+ self.files += [[int(pos), int(size), name.replace('\\040', ' ')]]
else:
raise errors.SyntaxError("Invalid manifest format")
@@ -799,8 +799,7 @@ class CollectionWriter(object):
self.finish_current_file()
self.set_current_file_name(newfilename)
def set_current_file_name(self, newfilename):
- newfilename = re.sub(r' ', '\\\\040', newfilename)
- if re.search(r'[ \t\n]', newfilename):
+ if re.search(r'[\t\n]', newfilename):
raise errors.AssertionError(
"Manifest filenames cannot contain whitespace: %s" %
newfilename)
@@ -825,7 +824,7 @@ class CollectionWriter(object):
self.finish_current_stream()
self.set_current_stream_name(newstreamname)
def set_current_stream_name(self, newstreamname):
- if re.search(r'[ \t\n]', newstreamname):
+ if re.search(r'[\t\n]', newstreamname):
raise errors.AssertionError(
"Manifest stream names cannot contain whitespace")
self._current_stream_name = '.' if newstreamname=='' else newstreamname
@@ -860,11 +859,11 @@ class CollectionWriter(object):
for stream in self._finished_streams:
if not re.search(r'^\.(/.*)?$', stream[0]):
manifest += './'
- manifest += stream[0]
+ manifest += stream[0].replace(' ', '\\040')
for locator in stream[1]:
manifest += " %s" % locator
for sfile in stream[2]:
- manifest += " %d:%d:%s" % (sfile[0], sfile[1], sfile[2])
+ manifest += " %d:%d:%s" % (sfile[0], sfile[1], sfile[2].replace(' ', '\\040'))
manifest += "\n"
return manifest
def data_locators(self):
diff --git a/sdk/python/bin/arv-get b/sdk/python/bin/arv-get
index 1025b8c..4154a3d 100755
--- a/sdk/python/bin/arv-get
+++ b/sdk/python/bin/arv-get
@@ -130,8 +130,6 @@ if not get_prefix:
logger.error(e)
sys.exit(1)
-get_prefix = get_prefix.replace(' ', '\\040')
-
reader = arvados.CollectionReader(collection)
# Scan the collection. Make an array of (stream, file, local
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list