Convert a lxml element to a serializable dict.
(elem, start_time, end_time)
| 4470 | |
| 4471 | |
| 4472 | def _programme_to_dict(elem, start_time, end_time): |
| 4473 | """Convert a <programme> lxml element to a serializable dict.""" |
| 4474 | title_el = elem.find('title') |
| 4475 | desc_el = elem.find('desc') |
| 4476 | sub_el = elem.find('sub-title') |
| 4477 | return { |
| 4478 | 'title': title_el.text if title_el is not None and title_el.text else '', |
| 4479 | 'description': desc_el.text if desc_el is not None and desc_el.text else '', |
| 4480 | 'sub_title': sub_el.text if sub_el is not None and sub_el.text else '', |
| 4481 | 'start_time': start_time.isoformat(), |
| 4482 | 'end_time': end_time.isoformat(), |
| 4483 | } |
| 4484 | |
| 4485 | |
| 4486 | def build_programme_index(source_id): |
no outgoing calls
no test coverage detected