Just for the record:

On 2011-03-23, Guenter Milde wrote:
> On 2011-03-23, Jürgen Spitzmüller wrote:
>> Also sprach Jean-Marc Lasgouttes:
>>>> Yes, I still have this message marked in my inbox. But you didn't yet
>>>> propose a working python code, did you?

>>>> OTOH JMarc's idea of using a test file strikes me not too bad.

>>> In my mind this is the same idea. Lime what is done in checkLatex().

>> I thought that Günter wanted to parse fontspec.sty for the date.

> I asked at comp.text.tex for a way to parse a LaTeX package for the
> date without loading it -- it turned out to be far more complicated
> than I expected and even the most advanced solutions by Heiko
> Oberdieck are not working in any valid case.

There is now a brand-new "filemod" package at CTAN
(http://www.ctan.org/pkg/filemod) which should be able to solve the
task. Instead of parsing the file, it looks at its modification date
which should suffice in many cases.

> This is why I considered using kpsewhich for locating fontspec.sty and
> parsing it with Python.
> (A Python function calling kpsewhich can be found in the small file
> kpathsea.py from the "pybtex" project. On my Debian machine it's
> /usr/share/pyshared/pybtex/kpathsea.py)

Following the "filemod" example, one could use the file's modification
date instead of parsing. However, the alternative way using a minimal
*.tex file as probe seems simpler.

Günter


Reply via email to