ž
¬ÿf$ c @ 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( u!
Generic dylib path manipulation
i Nu
dylib_infou‹ (?x)
(?P^.*)(?:^|/)
(?P
(?P\w+?)
(?:\.(?P[^._]+))?
(?:_(?P[^._]+))?
\.dylib$
)
c C s# t j | ƒ } | s d S| j ƒ S( u1
A dylib name can take one of the following four forms:
Location/Name.SomeVersion_Suffix.dylib
Location/Name.SomeVersion.dylib
Location/Name_Suffix.dylib
Location/Name.dylib
returns None if not found or a mapping equivalent to:
dict(
location='Location',
name='Name.SomeVersion_Suffix.dylib',
shortname='Name',
version='SomeVersion',
suffix='Suffix',
)
Note that SomeVersion and Suffix are optional and may be None
if not present.
N( u DYLIB_REu matchu Noneu groupdict( u filenameu is_dylib( ( u: /opt/alt/python33/lib64/python3.3/ctypes/macholib/dylib.pyu
dylib_info s c C s d d d d d d d „ } t d ƒ d k s3 t ‚ t d ƒ d k sK t ‚ t d ƒ | d d d ƒ k so t ‚ t d ƒ | d d
d d d ƒk s™ t ‚ t d
ƒ | d d d d ƒ k sÀ t ‚ t d ƒ | d d d d ƒ k sç t ‚ t d ƒ | d d d d d ƒ k st ‚ d S( Nc S s% t d | d | d | d | d | ƒ S( Nu locationu nameu shortnameu versionu suffix( u dict( u locationu nameu shortnameu versionu suffix( ( u: /opt/alt/python33/lib64/python3.3/ctypes/macholib/dylib.pyu d. s u test_dylib_info..du completely/invalidu completely/invalide_debugu P/Foo.dylibu Pu Foo.dylibu Foou P/Foo_debug.dylibu Foo_debug.dylibu suffixu debugu
P/Foo.A.dylibu Foo.A.dylibu Au P/Foo_debug.A.dylibu Foo_debug.A.dylibu Foo_debugu P/Foo.A_debug.dylibu Foo.A_debug.dylib( u Noneu
dylib_infou AssertionError( u d( ( u: /opt/alt/python33/lib64/python3.3/ctypes/macholib/dylib.pyu test_dylib_info- s $*''u test_dylib_infou __main__( u __doc__u reu __all__u compileu DYLIB_REu
dylib_infou test_dylib_infou __name__( ( ( u: /opt/alt/python33/lib64/python3.3/ctypes/macholib/dylib.pyu s