| Conditions | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 22 | def main(gmp, args): |
||
| 23 | # pylint: disable=unused-argument |
||
| 24 | |||
| 25 | response_xml = gmp.get_tasks() |
||
| 26 | tasks_xml = response_xml.xpath('task') |
||
| 27 | |||
| 28 | heading = ['ID', 'Name', 'Severity'] |
||
| 29 | |||
| 30 | rows = [] |
||
| 31 | |||
| 32 | for task in tasks_xml: |
||
| 33 | name = ''.join(task.xpath('name/text()')) |
||
| 34 | task_id = task.get('id') |
||
| 35 | severity = ''.join(task.xpath('last_report/report/severity/text()')) |
||
| 36 | |||
| 37 | rows.append([task_id, name, severity]) |
||
| 38 | |||
| 39 | print(Table(heading=heading, rows=rows)) |
||
| 40 | |||
| 44 |