Salut, On 28.06.07, Malte Forkel wrote: > After some experimenting with option syntax and quoting, I came up with > the following hacked version of find_file: > > def find_file(filename, kpse_file_format): > #command = 'kpsewhich --format="%s" %s' % (kpse_file_format, filename) > if ' ' in kpse_file_format: > #command = 'kpsewhich --file-type="%s" %s' % (kpse_file_format, > filename) > command = 'kpsewhich "%s" %s' % (kpse_file_format, filename) > else: > #command = 'kpsewhich "%s" %s' % (kpse_file_format, filename) > #command = 'kpsewhich %s %s' % (kpse_file_format, filename) > command = 'kpsewhich --format="%s" %s' % (kpse_file_format, > filename) > command = 'kpsewhich --format=%s %s' % (kpse_file_format, filename) > command = 'kpsewhich --file-type="%s" %s' % (kpse_file_format, > filename) > command = 'kpsewhich --file-type=%s %s' % (kpse_file_format, > filename) > if not find_file_cache.has_key(command): > find_file_cache[command] = os.popen(command, > "r").readline().strip() > return find_file_cache[command]
> Please note that the duplicate assignments to command are in there > just to illustrate what worked for me and what did not (so I > commented it out). Unfortenately, I could not find a form for the > call to kpsewhich that worked under all circumstances. Do I understand correctly that if there is no blank in kpse_file_format, then kpsewhich --format="%s" %s does not work? I would consider this a bug in kpsewhich. My version of kpsewhich doesn't have this problem. (linux, tetex3 with kpathsea version 3.5.4) > I used > --filetype instead of --format because according to the kpsewhich > usage string that is supposed to be deprecated. Which version of kpathsea comes with Miktex 2.6? In my version, there is no argument "--file-type". As teTeX is still a widely used distribution, we have to take this into account. Michael. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
