U 1`{@sdZddlmZmZddlZddlZddlZeZdZ dZ ddZ e fdd Z e e Z e e Zed Zd Zd Zd jeedZGdddZdddZdZedZeeeZdjeedZdZdZdS)u< Package metadata for the ‘python-daemon’ distribution. )absolute_importunicode_literalsNz python-daemonzversion_info.jsoncCs.d}zt|}Wntjk r(YnX|S)z Get the `Distribution` instance for distribution `name`. :param name: The distribution name for the query. :return: The `pkg_resources.Distribution` instance, or ``None`` if the distribution instance is not found. N) pkg_resourcesget_distributionZDistributionNotFound)name distributionrA/opt/alt/python38/lib/python3.8/site-packages/daemon/_metadata.pyrs rcCs6dddd}|dk r2||r2||}t|}|S)a= Get the version info from the installed distribution. :param distribution: The `pkg_resources.Distribution` instance representing the Python package to interrogate. :param filename: Base filename of the version info resource. :return: The version info as a mapping of fields. The version info is stored as a metadata file in the `distribution`. If the `distribution` is ``None``, or the version info metadata file is not found, the return value mapping fields have placeholder values. ZUNKNOWN) release_dateversionZ maintainerN)Z has_metadataZ get_metadatajsonloads)rfilename version_infoZcontentrrr get_distribution_version_info*s   rr z Ben Finneyzben+python@benfinney.id.auz{name} <{email}>)rZemailc@s&eZdZdZdddZddZeZdS) YearRangez% A range of years spanning a period. NcCs||_||_dS)Nbeginend)selfrrrrr __init__VszYearRange.__init__cCs2dj|d}|jdk r.|j|jkr.dj|d}|S)Nz{range.begin:04d})rangeu#{range.begin:04d}–{range.end:04d})formatrr)rtextrrr __unicode__Zs     zYearRange.__unicode__)N)__name__ __module__ __qualname____doc__rr__str__rrrr rSs rc CsNt|}ztj|d}Wnttfk r6d}YnX|j}t||d}|S)a Construct the year range given a start and possible end date. :param begin_year: The beginning year (text, 4 digits) for the range. :param end_date: The end date (text, ISO-8601 format) for the range, or a non-date token string. :return: The range of years as a `YearRange` instance. If the `end_date` is not a valid ISO-8601 date string, the range has ``None`` for the end year. z%Y-%m-%dNr)intdatetimestrptime TypeError ValueErrorZyearr)Z begin_yearZend_dateZend_year year_rangerrr make_year_rangeds   r&Z2001r u-Copyright © {year_range} {author} and others)r%authorzApache-2z https://pagure.io/python-daemon/)N)rZ __future__rrr!r rtypeZ __metaclass__Zdistribution_nameZversion_info_filenamerrrrZversion_installedZ author_nameZ author_emailrr'rr&Zcopyright_year_beginZ build_dateZcopyright_year_range copyrightlicenseZurlrrrr  s6