Add ``_url`` to ``urls`` as _``_attribute`` or to ``extra_data`` as ``_utype`` if already defined or no ``_attribute`` is provided.
(_url, _utype=None, _attribute=None)
| 2596 | urls = get_pypi_urls(name, version) |
| 2597 | |
| 2598 | def add_url(_url, _utype=None, _attribute=None): |
| 2599 | """ |
| 2600 | Add ``_url`` to ``urls`` as _``_attribute`` or to ``extra_data`` as |
| 2601 | ``_utype`` if already defined or no ``_attribute`` is provided. |
| 2602 | """ |
| 2603 | if _url: |
| 2604 | if _attribute and _attribute not in urls: |
| 2605 | urls[_attribute] = _url |
| 2606 | elif _utype: |
| 2607 | extra_data[_utype] = _url |
| 2608 | |
| 2609 | # get first as this is the most common one |
| 2610 | homepage_url = ( |