;ò µƒ^@c@sÀddgZdklZdklZdklZdklZdk l Z dk l Z dk lZd klZlZd klZeefZdefd „ƒYZdfd „ƒYZd S(s DistributionsFeature(s Distribution(s Extension(sRequire(sbuild_py(s build_ext(sinstall(s install_lib(sDistutilsOptionErrorsDistutilsPlatformError(sDistutilsSetupErrorcBs³tZdZed„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„ZRS(sª Distribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'features' -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. cCsœh|_h|_t|_g|_ti||ƒ|i i dt ƒ|i i dt ƒ|i i dt ƒ|i i dtƒ|io|iƒndS(Nsbuild_pys build_extsinstalls install_lib(sselfsfeaturess package_datasNones test_suitesrequiress _Distributions__init__sattrsscmdclasss setdefaultsbuild_pys build_extsinstalls install_libs_set_global_opts_from_features(sselfsattrs((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys__init__;s     cCs/ti|ƒ}|io|iƒn|SdS(s3Process features after parsing command line optionsN(s _Distributionsparse_command_linesselfsresultsfeaturess_finalize_features(sselfsresult((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysparse_command_lineHs  cCsd|iddƒSdS(s;Convert feature name to corresponding option attribute nameswith_s-s_N(snamesreplace(sselfsname((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys_feature_attrnameOscCsg}|iiƒ}x×|iiƒD]Æ\}}|i |t ƒ|i |ƒ|i o“|i }d}d}|iƒ o||f\}}n|id|t d||fƒ|id|t d||fƒd||d|\}}|i|ƒ o!|i |ƒ|i |dƒqqWdS(s9Add/remove features and resolve dependencies between themiiN( sselfsfeaturessitemssnamesfeaturesfeature_is_includedsenabledsNonesinclude_by_defaults include_ins _set_features exclude_from(sselfsenabledsnamesfeature((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys_finalize_featuresks !   cCst||i|ƒ|ƒdS(sSet feature's inclusion statusN(ssetattrsselfs_feature_attrnamesnamesstatus(sselfsnamesstatus((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys _set_feature|scCst||i|ƒƒSdS(sAReturn 1 if feature is included, 0 if excluded, 'None' if unknownN(sgetattrsselfs_feature_attrnamesname(sselfsname((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysfeature_is_included€scCsb|i|ƒdjo$|i|i}t|dƒ‚n|i|i|ƒ|i|dƒdS(s)Request inclusion of feature named 'name'is2 is required, but was excluded or is not availableiN( sselfsfeature_is_includedsnamesfeaturess descriptionsdescrsDistutilsOptionErrors include_ins _set_feature(sselfsnamesdescr((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysinclude_feature„s cKs\xU|iƒD]G\}}t|d|tƒ}|o||ƒq |i||ƒq WdS(sôAdd items to distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. s _include_N( sattrssitemssksvsgetattrsselfsNonesincludes _include_misc(sselfsattrssksvsinclude((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysincludes cCs+|d}|ioSgi}|iD]2}||jo|i|ƒ o||ƒq%q%~|_n|ioSgi}|iD]2}||jo|i|ƒ o||ƒq‚q‚~|_n|i oYgi}|i D]8}|i |jo|i i|ƒ o||ƒqßqß~|_ ndS(s9Remove packages, modules, and extensions in named packages.N( spackagespfxsselfspackagessappends_[1]sps startswiths py_moduless ext_modulessname(sselfspackages_[1]spfxsp((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysexclude_package¥s  S S cCsÔ|d}x=|ipfD]+}||jp |i|ƒotSqqWx=|ipfD]+}||jp |i|ƒotSq[q[WxC|ipfD]1}|i |jp|i i|ƒotSq›q›WdS(s<Return true if 'exclude_package(package)' would do somethings.N( spackagespfxsselfspackagessps startswithsTrues py_moduless ext_modulessname(sselfspackagespfxsp((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pyshas_contents_for¼s   #cCsçt|tƒ otd||fƒ‚nyt||ƒ}Wn#tj otd|ƒ‚nX|t j ot|tƒ ot|dƒ‚nN|oFt ||gi }|D]!}||jo||ƒq´q´~ƒndS(sAHandle 'exclude()' for list/tuple attrs without a special handlers(%s: setting must be a list or tuple (%r)s %s: No such distribution settings4: this setting cannot be changed via include/excludeN(s isinstancesvaluessequencesDistutilsSetupErrorsnamesgetattrsselfsoldsAttributeErrorsNonessetattrsappends_[1]sitem(sselfsnamesvaluesolds_[1]sitem((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys _exclude_miscÎscCsôt|tƒ otd||fƒ‚nyt||ƒ}Wn#tj otd|ƒ‚nX|t jot |||ƒnlt|tƒ ot|dƒ‚nGt |||gi }|D]!}||jo||ƒqÄqÄ~ƒdS(sAHandle 'include()' for list/tuple attrs without a special handlers%s: setting must be a list (%r)s %s: No such distribution settings4: this setting cannot be changed via include/excludeN(s isinstancesvaluessequencesDistutilsSetupErrorsnamesgetattrsselfsoldsAttributeErrorsNonessetattrsappends_[1]sitem(sselfsnamesvaluesolds_[1]sitem((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys _include_miscás cKs\xU|iƒD]G\}}t|d|tƒ}|o||ƒq |i||ƒq WdS(sRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. s _exclude_N( sattrssitemssksvsgetattrsselfsNonesexcludes _exclude_misc(sselfsattrssksvsexclude((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysexclude÷s cCs<t|tƒ otd|fƒ‚nt|i|ƒdS(Ns.packages: setting must be a list or tuple (%r)(s isinstancespackagesssequencesDistutilsSetupErrorsmapsselfsexclude_package(sselfspackages((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys_exclude_packagesscCs5|ii|_|ii|_ti|||ƒSdS(N(sselfs __class__sglobal_optionss negative_opts _Distributions_parse_command_optssparsersargs(sselfsparsersargs((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys_parse_command_optsscCs |i SdS(N(sselfsrequires(sself((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pyshas_dependenciessc Cs3h}x"|iiƒD]\}} x| iƒD]ô\}\}}|djoq/n|i ddƒ}|djo‚|i |ƒ} |i i ƒ}|it| dhƒƒx_|iƒD]*\}}||jo|}t}Pq¸q¸Wtdƒ‚n|djo t}n||i|hƒ|<   cCs|io|iSdS(s+Should this feature be included by default?N(sselfs availablesstandard(sself((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysinclude_by_default—scCsW|i ot|idƒ‚n|i|ix|iD]}|i |ƒq<WdS(sEnsure feature and its requirements are included in distribution You may override this in a subclass to perform additional operations on the distribution. Note that this method may be called more than once per feature, and so should be idempotent. s2 is required,but is not available on this platformN( sselfs availablesDistutilsPlatformErrors descriptionsdistsincludesextrassrequiressfsinclude_feature(sselfsdistsf((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys include_in›s  cCsC|i|i|io%x"|iD]}|i|ƒq$WndS(s2Ensure feature is excluded from distribution You may override this in a subclass to perform additional operations on the distribution. This method will be called at most once per feature, and only after all included features have been asked to include themselves. N(sdistsexcludesselfsextrassremovesitemsexclude_package(sselfsdistsitem((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys exclude_from²s   cCsIxB|iD]7}|i|ƒ o td|i||fƒ‚q q WdS(sçVerify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. sg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN(sselfsremovesitemsdistshas_contents_forsDistutilsSetupErrors description(sselfsdistsitem((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysvalidateÄs  ( s__name__s __module__s__doc__sFalsesTrues__init__sinclude_by_defaults include_ins exclude_fromsvalidate(((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pysFeatureIs 1   N(s__all__sdistutils.cores Distributions _Distributions Extensionssetuptools.dependssRequiressetuptools.command.build_pysbuild_pyssetuptools.command.build_exts build_extssetuptools.command.installsinstallssetuptools.command.install_libs install_libsdistutils.errorssDistutilsOptionErrorsDistutilsPlatformErrorsDistutilsSetupErrorstupleslistssequencesFeature(sDistutilsPlatformErrors__all__s ExtensionssequencesRequiresDistutilsSetupErrorsDistutilsOptionErrorsFeaturesinstalls Distributions install_libs _Distributions build_extsbuild_py((sO/mnt/gmirror/ports/devel/py-protocols/work/PyProtocols-0.9.3/setuptools/dist.pys?s          ÿ=