Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: gsd_generate_index.py

Issue 11338019: Fix field name changes for size and last modified for gsutil ls -L. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/gsd_generate_index/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gsd_generate_index.py
===================================================================
--- gsd_generate_index.py (revision 164746)
+++ gsd_generate_index.py (working copy)
@@ -56,10 +56,24 @@
assert p.returncode == 0
# Extract intersting fields.
fields = {}
- fields['size'] = FixupSize(re.search('\tObject size:\t([0-9]+)\n',
- p_stdout).group(1))
- fields['md5'] = re.search('\t(MD5|Etag):\t([^\n]+)\n', p_stdout).group(2)
- fields['date'] = re.search('\tLast mod:\t([^\n]+)\n', p_stdout).group(1)
+ size_search = re.search('\tContent-Length:\t([0-9]+)\n', p_stdout)
+ if size_search:
+ fields['size'] = FixupSize(size_search.group(1))
+ else:
+ fields['size'] = None
+
+ md5_search = re.search('\t(MD5|Etag):\t([^\n]+)\n', p_stdout)
+ if md5_search:
+ fields['md5'] = md5_search.group(2)
+ else:
+ fields['md5'] = None
+
+ date_search = re.search('\tCreation time:\t([^\n]+)\n', p_stdout)
+ if date_search:
+ fields['date'] = date_search.group(1)
+ else:
+ fields['date'] = None
+
return fields
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698