�
i f� � @ s\ d Z d d l Z d g Z e j d � Z d d � Z d d � Z e d k rX e � n d S) z%
Generic framework path manipulation
� N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
(?P<shortname>\w+).framework/
(?:Versions/(?P<version>[^/]+)/)?
(?P=shortname)
(?:_(?P<suffix>[^_]+))?
)$
c C s# t j | � } | s d S| j � S)a}
A framework name can take one of the following four forms:
Location/Name.framework/Versions/SomeVersion/Name_Suffix
Location/Name.framework/Versions/SomeVersion/Name
Location/Name.framework/Name_Suffix
Location/Name.framework/Name
returns None if not found, or a mapping equivalent to:
dict(
location='Location',
name='Name.framework/Versions/SomeVersion/Name_Suffix',
shortname='Name',
version='SomeVersion',
suffix='Suffix',
)
Note that SomeVersion and Suffix are optional and may be None
if not present
N)�STRICT_FRAMEWORK_RE�match� groupdict)�filenameZis_framework� r �>/opt/alt/python34/lib64/python3.4/ctypes/macholib/framework.pyr s c C s d d d d d d d � } d S)Nc S s% t d | d | d | d | d | � S)N�location�name� shortname�version�suffix)�dict)r r
r r r
r r r �d- s ztest_framework_info.<locals>.dr )r r r r �test_framework_info, s r �__main__)�__doc__�re�__all__�compiler r r �__name__r r r r �<module> s