3 \$@s>dZddlZdgZejdZddZddZedkr:edS) z! Generic dylib path manipulation N dylib_infoz(?x) (?P^.*)(?:^|/) (?P (?P\w+?) (?:\.(?P[^._]+))? (?:_(?P[^._]+))? \.dylib$ ) cCstj|}|sdS|jS)a1 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)DYLIB_REmatch groupdict)filenameZis_dylibr-/usr/lib64/python3.6/ctypes/macholib/dylib.pyrs cCsddd}tddksttddks*ttd|dddksBttd |dd dd d ks^ttd |ddddksxttd|ddddksttd|ddddd kstdS)NcSst|||||dS)N)locationname shortnameversionsuffix)dict)r r r r r rrrd.s ztest_dylib_info..dzcompletely/invalidzcompletely/invalide_debugz P/Foo.dylibPz Foo.dylibZFoozP/Foo_debug.dylibzFoo_debug.dylibdebug)r z P/Foo.A.dylibz Foo.A.dylibAzP/Foo_debug.A.dylibzFoo_debug.A.dylibZ Foo_debugzP/Foo.A_debug.dylibzFoo.A_debug.dylib)NNNNN)rAssertionError)rrrrtest_dylib_info-s r__main__)__doc__re__all__compilerrr__name__rrrrs