(key, content, fmat='attr')
| 524 | |
| 525 | @staticmethod |
| 526 | def search_content(key, content, fmat='attr'): |
| 527 | if fmat == 'attr': |
| 528 | pm = re.search(key + '\s?=\s?"([^"<]+)"', content) |
| 529 | if pm: |
| 530 | return pm.group(1) |
| 531 | elif fmat == 'xml': |
| 532 | pm = re.search('<{0}>([^<]+)</{0}>'.format(key), content) |
| 533 | if pm: |
| 534 | return pm.group(1) |
| 535 | return 'unknown' |
| 536 | |
| 537 | def run(self): |
| 538 | self.get_uuid() |