summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEarl Ou <shunhsingou@google.com>2012-10-17 05:59:15 (GMT)
committerEarl Ou <shunhsingou@google.com>2012-10-17 05:59:15 (GMT)
commit144dc616219e088680c267ae6a0463364b33c41d (patch)
tree04d6b06fd180856294ea1c5399133ec8501a40e5 /tests
parent030bf17cb3792e9f9e0492e0d0e24f6cb819c7e0 (diff)
downloadandroid_packages_apps_Snap-144dc616219e088680c267ae6a0463364b33c41d.zip
android_packages_apps_Snap-144dc616219e088680c267ae6a0463364b33c41d.tar.gz
android_packages_apps_Snap-144dc616219e088680c267ae6a0463364b33c41d.tar.bz2
Do not use parentheses for Model tag in exiftool parser
Change-Id: Idc45cd389976f0c474dceb550790a6814cb380b8
Diffstat (limited to 'tests')
-rwxr-xr-xtests/exiftool_parser/parser.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/exiftool_parser/parser.py b/tests/exiftool_parser/parser.py
index 351c1b6..5de54a3 100755
--- a/tests/exiftool_parser/parser.py
+++ b/tests/exiftool_parser/parser.py
@@ -63,23 +63,22 @@ for s in tags:
ifds.pop()
layer = new_layer
+ # find the ID
+ _id = re.search("0x[0-9a-f]{4}", s)
+ _id = _id.group(0)
+
+ # find the name
+ name = re.search("[0-9]*?\).*? = ", s)
+ name = name.group(0)[4:-3]
+
# find the raw value in the parenthesis
value = re.search("\(.*\)\n", s)
- if value:
+ if (name != 'Model' and value):
value = value.group(0)[1:-2]
else:
value = re.search("=.*\n", s)
value = value.group(0)[2:-1]
- # find the ID
- p = re.compile("0x[0-9a-f]{4}")
- _id = p.search(s)
- _id = _id.group(0)
-
- # find the name
- p = re.compile("[0-9]*?\).*? = ")
- name = p.search(s)
- name = name.group(0)[4:-3]
print (' <tag ifd="' + ifds[-1] + '" id="'
+ _id + '" name="' + name +'">' + value + "</tag>")
print "</exif>"