2 # This file should help users tracking problems with their TeX installation
3 # It spits out a lot of information about the Python installation, the PyX
4 # installation and the environment in which PyX will try to use TeX/LaTeX.
6 import sys
, os
, subprocess
7 #sys.path.insert(0, "..")
8 #sys.path.insert(0, "../build/lib.linux-x86_64-2.5")
11 #pyx.text.set(fontmaps="psfonts.map psfonts.cmz")
13 def test_installation():
15 from pyx
.pykpathsea
import _pykpathsea
16 compiled_pykpathsea
= True
18 compiled_pykpathsea
= False
20 print("Platform is %s" % sys
.platform
)
21 print("Python installation prefix is %s" % sys
.prefix
)
22 print("Python executable is %s" % sys
.executable
)
23 print("PyX comes from %s" % pyx
.__file
__)
24 print("PyX version %s" % pyx
.__version
__)
25 if compiled_pykpathsea
:
26 print("PyX pykpathsea compiled from C module")
28 print("PyX pykpathsea python module used")
32 for command
in [r
"echo $0 \"$
*\"",
34 r"echo $BASH_SUBSHELL
",
44 r"file `which kpsewhich`
",
46 r"file `which latex`
",
48 stdin, stdout, stderr = os.popen3(command)
49 print("\"%22s
\" -->" % (command), end=' ')
51 print(" %s" % line, end=' ')
52 for x in [stdin, stdout, stderr]:
60 "pyx
.pykpathsea
.kpse_gf_format
",
61 "pyx
.pykpathsea
.kpse_pk_format
",
62 # "pyx
.pykpathsea
.kpse_any_glyph_format
", # gives segmentation fault
63 "pyx
.pykpathsea
.kpse_tfm_format
",
64 "pyx
.pykpathsea
.kpse_afm_format
",
65 "pyx
.pykpathsea
.kpse_base_format
",
66 "pyx
.pykpathsea
.kpse_bib_format
",
67 "pyx
.pykpathsea
.kpse_bst_format
",
68 "pyx
.pykpathsea
.kpse_cnf_format
",
69 "pyx
.pykpathsea
.kpse_db_format
",
70 "pyx
.pykpathsea
.kpse_fmt_format
",
71 "pyx
.pykpathsea
.kpse_fontmap_format
",
72 "pyx
.pykpathsea
.kpse_mem_format
",
73 "pyx
.pykpathsea
.kpse_mf_format
",
74 "pyx
.pykpathsea
.kpse_mfpool_format
",
75 "pyx
.pykpathsea
.kpse_mft_format
",
76 "pyx
.pykpathsea
.kpse_mp_format
",
77 "pyx
.pykpathsea
.kpse_mppool_format
",
78 "pyx
.pykpathsea
.kpse_mpsupport_format
",
79 "pyx
.pykpathsea
.kpse_ocp_format
",
80 "pyx
.pykpathsea
.kpse_ofm_format
",
81 "pyx
.pykpathsea
.kpse_opl_format
",
82 "pyx
.pykpathsea
.kpse_otp_format
",
83 "pyx
.pykpathsea
.kpse_ovf_format
",
84 "pyx
.pykpathsea
.kpse_ovp_format
",
85 # "pyx
.pykpathsea
.kpse_pict_format
", # unknown in python module
86 "pyx
.pykpathsea
.kpse_tex_format
",
87 "pyx
.pykpathsea
.kpse_texdoc_format
",
88 "pyx
.pykpathsea
.kpse_texpool_format
",
89 "pyx
.pykpathsea
.kpse_texsource_format
",
90 "pyx
.pykpathsea
.kpse_tex_ps_header_format
",
91 # "pyx
.pykpathsea
.kpse_troff_font_format
", (takes too long)
92 "pyx
.pykpathsea
.kpse_type1_format
",
93 "pyx
.pykpathsea
.kpse_vf_format
",
94 "pyx
.pykpathsea
.kpse_dvips_config_format
",
95 "pyx
.pykpathsea
.kpse_ist_format
",
96 "pyx
.pykpathsea
.kpse_truetype_format
",
97 "pyx
.pykpathsea
.kpse_type42_format
",
98 "pyx
.pykpathsea
.kpse_web2c_format
",
99 "pyx
.pykpathsea
.kpse_program_text_format
",
100 "pyx
.pykpathsea
.kpse_program_binary_format
",
101 "pyx
.pykpathsea
.kpse_miscfonts_format
",
102 "pyx
.pykpathsea
.kpse_web_format
",
103 "pyx
.pykpathsea
.kpse_cweb_format
",
104 "pyx
.pykpathsea
.kpse_enc_format
",
105 "pyx
.pykpathsea
.kpse_cmap_format
",
106 "pyx
.pykpathsea
.kpse_subfont_definition_format
",
107 "pyx
.pykpathsea
.kpse_opentype_format
",
108 "pyx
.pykpathsea
.kpse_pdftex_config_format
",
109 "pyx
.pykpathsea
.kpse_lig_format
",
110 "pyx
.pykpathsea
.kpse_texmfscripts_format
",
111 "pyx
.pykpathsea
.kpse_lua_format
",
112 "pyx
.pykpathsea
.kpse_font_feature_format
",
113 "pyx
.pykpathsea
.kpse_cid_maps_format
",
114 "pyx
.pykpathsea
.kpse_mlbib_format
",
115 "pyx
.pykpathsea
.kpse_mlbst_format
"]:
117 allformats.append(eval(formatstr))
118 allnames[eval(formatstr)] = formatstr
119 except AttributeError:
122 if pyx.__version__ in ["0.10"]:
123 fontmaps = pyx.text.defaulttexrunner.fontmaps.split()
126 fontmaps += pyx.config.getlist("text
", "pdffontmaps
", ["pdftex
.map"])
127 fontmaps += pyx.config.getlist("text
", "psfontmaps
", ["psfonts
.map"])
128 for fontmap in fontmaps:
130 for form in allformats:
131 mappath = pyx.pykpathsea.find_file(fontmap, form)
134 print("\"%s\" found at
\"%s\" as format
\"%s\"" % (fontmap, mappath, allnames[form]))
136 print("\"%s\" not found
" % fontmap)