Return a list of keywords found in a ``metainfo`` object or mapping.
(metainfo, location=None)
| 1882 | |
| 1883 | |
| 1884 | def get_description(metainfo, location=None): |
| 1885 | """ |
| 1886 | Return a list of keywords found in a ``metainfo`` object or mapping. |
| 1887 | """ |
| 1888 | description = None |
| 1889 | # newer metadata versions use the payload for the description |
| 1890 | if hasattr(metainfo, 'get_payload'): |
| 1891 | description = metainfo.get_payload() |
| 1892 | description = description and description.strip() or None |
| 1893 | if not description: |
| 1894 | # legacymetadata versions use the Description for the description |
| 1895 | description = get_attribute(metainfo, 'Description') |
| 1896 | if not description and location: |
| 1897 | # older metadata versions can use a DESCRIPTION.rst file |
| 1898 | description = get_legacy_description(location=fileutils.parent_directory(location)) |
| 1899 | |
| 1900 | summary = get_attribute(metainfo, 'Summary') |
| 1901 | description = clean_description(description) |
| 1902 | return build_description(summary, description) |
| 1903 | |
| 1904 | |
| 1905 | def clean_description(description): |
no test coverage detected