Package: scons-tool-kpsewhich
This tool providesSConswith interface to kpsewhich utility. The kpsewhich
program is a part ofkpathsealibrary, which in turn is a part of TeX Live
distribution. Its purpose is to search within theTeX directory structure(TDS) for files such as TeX classes, styles, BibTeX databases, fonts etc. For
more informations seekpathsea manualand informations aboutTeX directory
structure(TDS).This tool appends new methods to the SCons Environment. It does not provide any
builders, but rather equips SCons Environment with methods that callkpsewhichprogram during the SConscript-reading phase. This tool does not
produce any files, it is thought as an extension for obtaining textual
information from external program.INSTALLATIONThere are few ways to install this tool for your project.FrompypiThis method may be preferable if you build your project under a virtualenv. To
add kpsewhich tool frompypi, type (within your wirtualenv):pipinstallscons-tool-loaderscons-tool-kpsewhichor, if your project usespipenv:pipenvinstall--devscons-tool-loaderscons-tool-kpsewhichAlternatively, you may add this to yourPipfile[dev-packages]
scons-tool-loader = "*"
scons-tool-kpsewhich = "*"The tool will be installed as a namespaced packagesconstool.kpsewhichin project’s virtual environment. You may further usescons-tool-loaderto load the tool.As a git submoduleCreate new git repository:mkdir/tmp/prj&&cd/tmp/prjtouchREADME.rstgitinitAdd thescons-tool-kpsewhichas a submodule:gitsubmoduleaddgit://github.com/ptomulik/scons-tool-kpsewhich.gitsite_scons/site_tools/kpsewhichFor python 2.x create__init__.pyinsite_toolsdirectory:touchsite_scons/site_tools/__init__.pythis will allow to directly importsite_tools.kpsewhich(this may be required by other tools).USAGE EXAMPLESFind filesarticle.clsandamsmath.styused bylatex:env=Environment(tools=['tex','kpsewhich'])files=env.KPSFindFiles(['article.cls','amsmath.sty'],progname='$LATEX')Find all occurrences ofunicode.styfile in TDS:env=Environment(tools=['kpsewhich'])files=env.KPSFindAllFiles('unicode.sty')Other functions (correspond directly tokpsewhichfunction options):texmf=env.KPSExpandBraces('a{b,c}d')# kpsewhich -expand-braces 'a{b,c}d'texmf=env.KPSExpandPath('$TEXMF')# kpsewhich -expand-path '$TEXMF'texmf=env.KPSExpandVar('$TEXMF')# kpsewhich -expand-var '$TEXMF'texpath=env.KPSShowPath('tex')# kpsewhich -show-path 'tex'home=env.KPSVarValue('TEXMFHOME')# kpsewhich -var-value 'TEXMFHOME'CONSTRUCTION VARIABLESThe following construction variables may be used to configure thekpsewhichtool. They may be also provided as keyword arguments toKPSXxx()methods.VariableDescriptionKPSEWHICHthekpsewhichexecutableKPSEWHICHFLAGSadditional flags tokpsewhichKPSVARIABLES(re)define variables forkpsewhichKPSVARIABLESmust be a dictionary in form{ NAME : VALUE },
for example:KPSVARIABLES={"TEXMFHOME":"/home/ptomulik/texmf"}ARGUMENTSThese arguments are accepted by someKPSXxx()methods. All the methods acceptprogname. All other arguments are accepted byKPSFindFilesandKPSFindAllFiles.VariableDescriptiondpicorresponds to-dpiflag,formatcorresponds to-formatflag,pathcorresponds to-pathflagprognamecorresponds to-prognameflagsubdircorresponds to-subdirflagLICENSECopyright (c) 2013-2020 by Paweł TomulikPermission 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