Skip to content

Commit

Permalink
Support removal of arrays
Browse files Browse the repository at this point in the history
Match patterns such as "string-array" that would previously only return "array", and subsequently fail in `remove_resource_value`
  • Loading branch information
timrae committed Apr 1, 2015
1 parent 73eef7f commit a1e0a5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion android_clean_app.py
Expand Up @@ -40,7 +40,13 @@ def add_element(self, message):
if res_all:
res = res_all[0]
bits = res.split('.')[-2:]
self.elements.append((bits[0], bits[1]))
if bits[0] != 'array':
type=bits[0]
else:
# array is a generic type, which may take form string-array, integer-array, etc.
# The only way to get type is to parse from errorLine1 which is less reliable than message.
type=re.findall(Issue.pattern_array, errorLine1)[0][0]
self.elements.append((type, bits[1]))
else:
print("The pattern '%s' seems to find nothing in the error message '%s'. We can't find the resource and can't remove it. The pattern might have changed, please check and report this in github issues." % (
Issue.pattern, message))
Expand Down

0 comments on commit a1e0a5a

Please sign in to comment.