remove shebang -- see comment 3 on https://bugzilla.redhat.com/bugzilla/show_bug...
[PyX/mjg.git] / pyx / pykpathsea / __init__.py
blob6a9c0eeeb25a0990d87304c17ceee6b9ed6b37b3
1 # -*- coding: ISO-8859-1 -*-
4 # Copyright (C) 2003-2004 Jörg Lehmann <joergl@users.sourceforge.net>
5 # Copyright (C) 2003-2004 André Wobst <wobsta@users.sourceforge.net>
7 # This file is part of PyX (http://pyx.sourceforge.net/).
9 # PyX is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # PyX is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with PyX; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 try:
25 from _pykpathsea import *
26 except:
27 import os
28 find_file_cache = {}
29 def find_file(filename, kpse_file_format):
30 command = 'kpsewhich --format="%s" %s' % (kpse_file_format, filename)
31 if not find_file_cache.has_key(command):
32 find_file_cache[command] = os.popen(command, "r").readline().strip()
33 return find_file_cache[command]
34 kpse_gf_format = "gf"
35 kpse_pk_format = "pk"
36 kpse_any_glyph_format = "bitmap font"
37 kpse_tfm_format = "tfm"
38 kpse_afm_format = "afm"
39 kpse_base_format = "base"
40 kpse_bib_format = "bib"
41 kpse_bst_format = "bst"
42 kpse_cnf_format = "cnf"
43 kpse_db_format = "ls-R"
44 kpse_fmt_format = "fmt"
45 kpse_fontmap_format = "map"
46 kpse_mem_format = "mem"
47 kpse_mf_format = "mf"
48 kpse_mfpool_format = "mfpool"
49 kpse_mft_format = "mft"
50 kpse_mp_format = "mp"
51 kpse_mppool_format = "mppool"
52 kpse_mpsupport_format = "MetaPost support"
53 kpse_ocp_format = "ocp"
54 kpse_ofm_format = "ofm"
55 kpse_opl_format = "opl"
56 kpse_otp_format = "otp"
57 kpse_ovf_format = "ovf"
58 kpse_ovp_format = "ovp"
59 kpse_pict_format = "graphics/figure"
60 kpse_tex_format = "tex"
61 kpse_texdoc_format = "TeX system documentation"
62 kpse_texpool_format = "texpool"
63 kpse_texsource_format = "TeX system sources"
64 kpse_tex_ps_header_format = "PostScript header"
65 kpse_troff_font_format = "Troff fonts"
66 kpse_type1_format = "type1 fonts"
67 kpse_vf_format = "vf"
68 kpse_dvips_config_format = "dvips config"
69 kpse_ist_format = "ist"
70 kpse_truetype_format = "truetype fonts"
71 kpse_type42_format = "type42 fonts"
72 kpse_web2c_format = "web2c"
73 kpse_program_text_format = "other text files"
74 kpse_program_binary_format = "other binary files"
75 kpse_miscfonts_format = "misc fonts"
76 kpse_web_format = "web"
77 kpse_cweb_format = "cweb"