;ς e=c@sŽdZdkZdkZdkZdklZlZlZdkl Z dk l Z dk l Z dfd„ƒYZde fd „ƒYZdS( sinstall_data.py Provides a more sophisticated facility to install data files than distutils' install_data does. You can specify your files as a template like in MANIFEST.in and you have more control over the copy process. Copyright 2000 by Rene Liebscher, Germany. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. N(s StringTypes TupleTypesListType(s change_root(sFileList(s install_datas Data_FilescBsDtZdZeeeeddd„Zd„Zd„Zd„ZRS(sΗ container for list of data files. supports alternate base_dirs e.g. 'install_lib','install_header',... supports a directory where to copy files supports templates as in MANIFEST.in supports preserving of paths in filenames eg. foo/xyz is copied to base_dir/foo/xyz supports stripping of leading dirs of source paths eg. foo/bar1/xyz, foo/bar2/abc can be copied to bar1/xyz, bar2/abc ic Csœ||_||_||_|tj oLg}x9|D]1}ti |ƒ}| oq5n|i |ƒq5W|}n||_||_ ||_ d|_ dS(Ni(sbase_dirsselfsfilesscopy_tostemplatesNonestsitemsstringsstripsappends preserve_paths strip_dirss finalized( sselfsbase_dirsfilesscopy_tostemplates preserve_paths strip_dirssitemst((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys__init__:s         cCstiidd|fƒdS(Nswarning: %s: %s s install_data(ssyssstderrswritesmsg(sselfsmsg((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pyswarnJscCs!dkl}|o |GHndS(s~Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. (sDEBUGN(sdistutils.coresDEBUGsmsg(sselfsmsgsDEBUG((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys debug_printNs cCsθ|iodSn|itjo g|_n|itjoœt|iƒtjoti|idƒ|_nt |i |i ƒ}x'|iD]}|iti|ƒƒqW|iƒ|iƒ|ii|iƒnd|_dS(s: complete the files list by processing the given template Ns;i(sselfs finalizedsfilessNonestemplatestypes StringTypesstringssplitsFileListswarns debug_printsfilelistslinesprocess_template_linesstripssortsremove_duplicatessextend(sselfsfilelistsline((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pysfinalizeWs      (s__name__s __module__s__doc__sNones__init__swarns debug_printsfinalize(((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys Data_Files/s   sinstall_Data_FilescBs,tZd„Zd„Zd„Zd„ZRS(NcCsΣt|tƒ o°|idƒt|ƒtjoYt|ƒdjpt|dƒtj o t d‚ntd|dd|dƒ}qΑt|ƒt j o t d‚ntd|gƒ}n|i ƒ|SdS( su check if data are in new format, if not create a suitable object. returns finalized data object sHold-style data files list found -- please convert to Data_Files instanceiisieach element of 'data_files' option must be an Data File instance, a string or 2-tuple (string,[strings])scopy_toisfilesN( s isinstancesds Data_Filessselfswarnstypes TupleTypeslensListTypesDistutilsSetupErrors StringTypesfinalize(sselfsd((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys check_dataos + !  cCsg|_|idƒ}xχ|iD]μ}|i|ƒ}|i}|it jot ||iƒ}n|i t joct i i|i ƒ ot i i||i ƒ}qπ|iot|i|i ƒ}qπ|i }n|}|id|ƒt i i|ƒ}|i|ƒxό|iD]ρ}|idjo;titit i i|ƒt iƒ|it iƒ}n|}|ioM|it i it i i||ƒƒƒ|i |t i i||ƒƒ}n|i ||ƒ}t"|ƒt#jo|d}n|ii$|ƒqWq"W|iSdS(NsinstallsVsetup script did not provide a directory to copy files to -- installing right in '%s'i(%sselfsoutfilessget_finalized_commands install_cmds data_filessds check_datas install_dirsbase_dirsNonesgetattrscopy_tososspathsisabssjoinsdirsroots change_rootswarnsnormpathsmkpathsfilesssrcs strip_dirssstringssplitsnormcasessepsdsts preserve_pathsdirnames copy_filesoutstypes TupleTypesappend(sselfssrcsds install_cmds install_dirsoutsdstsdir((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pysrun…s>       ; (%cCsAg}x0|iD]%}|i|ƒ}|i|iƒqW|SdS(N(sinputssselfs data_filessds check_datasappendsfiles(sselfsinputssd((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys get_inputsΉs  cCs |iSdS(N(sselfsoutfiles(sself((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys get_outputsΐs(s__name__s __module__s check_datasruns get_inputss get_outputs(((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pysinstall_Data_Filesms  4 (s__doc__sosssyssstringstypess StringTypes TupleTypesListTypesdistutils.utils change_rootsdistutils.filelistsFileListsdistutils.command.install_datas install_datas Data_Filessinstall_Data_Files( s StringTypesstrings install_datas change_rootsFileListssyssListTypes Data_Filess TupleTypesossinstall_Data_Files((sL/mnt/gmirror/ports/textproc/py-xml/work/PyXML-0.8.4/setupext/install_data.pys?s   >