\converter agr ppm "gracebat -hardcopy -printfile $$o -hdevice PNM $$i 2>/dev/null" ""''',
''])
#
- checkProg('a Dot -> PDF converter', ['dot -Tpdf $$i -o $$o'],
- rc_entry = [ r'\converter dot pdf "%%" ""'])
+ checkProg('a Dot -> Image converter', ['dot'],
+ rc_entry = [
+ r'''\converter dot eps "dot -Teps $$i -o $$o" ""
+\converter dot pdf "dot -Tpdf $$i -o $$o" ""
+\converter dot png "dot -Tpng $$i -o $$o" ""''',
+ ''])
#
checkProg('a Dia -> PNG converter', ['dia -e $$o -t png $$i'],
rc_entry = [ r'\converter dia png "%%" ""'])
checkProgAlternatives('BibTeX or alternative programs', ['bibtex', 'bibtex8', 'biber'],
rc_entry = [ r'\bibtex_command "%%"' ],
alt_rc_entry = [ r'\bibtex_alternatives "%%"' ])
- checkProg('JBibTeX, the Japanese BibTeX', ['jbibtex', 'bibtex'],
+ checkProg('JBibTeX, the Japanese BibTeX', ['pbibtex', 'jbibtex', 'bibtex'],
rc_entry = [ r'\jbibtex_command "%%"' ])
checkProgAlternatives('available index processors', ['texindy', 'makeindex -c -q'],
rc_entry = [ r'\index_command "%%"' ],
We expect output:
"ModuleName" "filename" "Description" "Packages" "Requires" "Excludes" "Category"
'''
- p = re.compile(r'\DeclareLyXModule\s*(?:\[([^]]*?)\])?{(.*)}')
- r = re.compile(r'#+\s*Requires: (.*)')
- x = re.compile(r'#+\s*Excludes: (.*)')
- c = re.compile(r'#+\s*Category: (.*)')
- b = re.compile(r'#+\s*DescriptionBegin\s*$')
- e = re.compile(r'#+\s*DescriptionEnd\s*$')
+ remods = re.compile(r'\DeclareLyXModule\s*(?:\[([^]]*?)\])?{(.*)}')
+ rereqs = re.compile(r'#+\s*Requires: (.*)')
+ reexcs = re.compile(r'#+\s*Excludes: (.*)')
+ recaty = re.compile(r'#+\s*Category: (.*)')
+ redbeg = re.compile(r'#+\s*DescriptionBegin\s*$')
+ redend = re.compile(r'#+\s*DescriptionEnd\s*$')
modname = desc = pkgs = req = excl = catgy = ""
readingDescription = False
for line in open(file).readlines():
if readingDescription:
- res = e.search(line)
+ res = redend.search(line)
if res != None:
readingDescription = False
desc = " ".join(descLines)
+ # Escape quotes.
+ desc = desc.replace('"', '\\"')
continue
descLines.append(line[1:].strip())
continue
- res = b.search(line)
+ res = redbeg.search(line)
if res != None:
readingDescription = True
continue
- res = p.search(line)
+ res = remods.search(line)
if res != None:
(pkgs, modname) = res.groups()
if pkgs == None:
tmp = [s.strip() for s in pkgs.split(",")]
pkgs = ",".join(tmp)
continue
- res = r.search(line)
+ res = rereqs.search(line)
if res != None:
req = res.group(1)
tmp = [s.strip() for s in req.split("|")]
req = "|".join(tmp)
continue
- res = x.search(line)
+ res = reexcs.search(line)
if res != None:
excl = res.group(1)
tmp = [s.strip() for s in excl.split("|")]
excl = "|".join(tmp)
continue
- res = c.search(line)
+ res = recaty.search(line)
if res != None:
catgy = res.group(1)
continue
- if modname != "":
- if pkgs != "":
- # this module has some latex dependencies:
- # append the dependencies to chkmodules.tex,
- # which is \input'ed by chkconfig.ltx
- testpackages = list()
- for pkg in pkgs.split(","):
- if "->" in pkg:
- # this is a converter dependency: skip
- continue
- if pkg.endswith(".sty"):
- pkg = pkg[:-4]
- testpackages.append("\\TestPackage{%s}" % (pkg,))
- cm = open('chkmodules.tex', 'a')
- for line in testpackages:
- cm.write(line + '\n')
- cm.close()
- return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, pkgs, req, excl, catgy)
- logger.warning("Module file without \DeclareLyXModule line. ")
- return ""
+
+ if modname == "":
+ logger.warning("Module file without \DeclareLyXModule line. ")
+ return ""
+
+ if pkgs != "":
+ # this module has some latex dependencies:
+ # append the dependencies to chkmodules.tex,
+ # which is \input'ed by chkconfig.ltx
+ testpackages = list()
+ for pkg in pkgs.split(","):
+ if "->" in pkg:
+ # this is a converter dependency: skip
+ continue
+ if pkg.endswith(".sty"):
+ pkg = pkg[:-4]
+ testpackages.append("\\TestPackage{%s}" % (pkg,))
+ cm = open('chkmodules.tex', 'a')
+ for line in testpackages:
+ cm.write(line + '\n')
+ cm.close()
+
+ return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, pkgs, req, excl, catgy)
+
def checkTeXAllowSpaces():