\Format tiff tif TIFF "" "%s" "%s" "" "image/tiff"
\Format xbm xbm XBM "" "%s" "%s" "" "image/x-xbitmap"
\Format xpm xpm XPM "" "%s" "%s" "" "image/x-xpixmap"'''
- path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'kview', 'gimp-remote', 'gimp'], rc_entry = [imageformats])
- path, ie = checkEditorNoRC('a raster image editor', ['gimp-remote', 'gimp'], rc_entry = [imageformats])
- addToRC(imageformats %
- (iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie) )
+ path, iv = checkViewerNoRC('a raster image viewer',
+ ['xv', 'gwenview', 'kview',
+ 'eog', 'xviewer', 'ristretto', 'gpicview', 'lximage-qt',
+ 'xdg-open', 'gimp-remote', 'gimp'],
+ rc_entry = [imageformats])
+ path, ie = checkEditorNoRC('a raster image editor',
+ ['gimp-remote', 'gimp'], rc_entry = [imageformats])
+ addToRC(imageformats % ((iv, ie)*10))
#
checkViewerEditor('a text editor',
['xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
- 'nedit', 'gedit', 'notepad',
- 'geany', 'leafpad', 'mousepad', 'xed'],
+ 'nedit', 'gedit', 'geany', 'leafpad', 'mousepad', 'xed', 'notepad'],
rc_entry = [r'''\Format asciichess asc "Plain text (chess output)" "" "" "%%" "" ""
\Format docbook sgml DocBook B "" "%%" "document,menu=export" ""
\Format docbook-xml xml "DocBook (XML)" "" "" "%%" "document,menu=export" "application/docbook+xml"
\Format eps3 eps "EPS (cropped)" "" "%%" "" "document" ""
\Format ps ps Postscript t "%%" "" "document,vector,menu=export" "application/postscript"'''])
# for xdg-open issues look here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
+ # maybe use "bestApplication()" from https://github.com/jleclanche/python-mime
# the MIME type is set for pdf6, because that one needs to be autodetectable by libmime
checkViewer('a PDF previewer',
['pdfview', 'kpdf', 'okular', 'qpdfview --unique',
rc_entry = [ r'\chktex_command "%%"' ])
checkProgAlternatives('BibTeX or alternative programs',
['bibtex', 'bibtex8', 'biber'],
- rc_entry = [ r'\bibtex_command "%%"' ],
+ rc_entry = [ r'\bibtex_command "automatic"' ],
alt_rc_entry = [ r'\bibtex_alternatives "%%"' ])
- checkProg('a specific Japanese BibTeX variant',
- ['pbibtex', 'jbibtex', 'bibtex'],
- rc_entry = [ r'\jbibtex_command "%%"' ])
+ checkProgAlternatives('a specific Japanese BibTeX variant',
+ ['pbibtex', 'upbibtex', 'jbibtex', 'bibtex', 'biber'],
+ rc_entry = [ r'\jbibtex_command "automatic"' ],
+ alt_rc_entry = [ r'\jbibtex_alternatives "%%"' ])
checkProgAlternatives('available index processors',
['texindy', 'makeindex -c -q', 'xindy'],
rc_entry = [ r'\index_command "%%"' ],
% (modname, filename, desc, pkgs, req, excl, catgy))
+def checkCiteEnginesConfig():
+ removeFiles(['lyxciteengines.lst', 'chkciteengines.tex'])
+
+ logger.info('+checking list of cite engines... ')
+ tx = open('lyxciteengines.lst', 'w')
+ tx.write('''## This file declares cite engines and their associated definition files.
+## It has been automatically generated by configure
+## Use "Options/Reconfigure" if you need to update it after a
+## configuration change.
+## "CiteEngineName" "filename" "CiteEngineType" "CiteFramework" "DefaultBiblio" "Description" "Packages"
+''')
+
+ # build the list of available modules
+ seen = []
+ # note that this searches the local directory first, then the
+ # system directory. that way, we pick up the user's version first.
+ for file in glob.glob( os.path.join('citeengines', '*.citeengine') ) + \
+ glob.glob( os.path.join(srcdir, 'citeengines', '*.citeengine' ) ) :
+ # valid file?
+ logger.info(file)
+ if not os.path.isfile(file):
+ continue
+
+ filename = file.split(os.sep)[-1]
+ filename = filename[:-11]
+ if seen.count(filename):
+ continue
+
+ seen.append(filename)
+ retval = processCiteEngineFile(file, filename, bool_docbook)
+ if retval != "":
+ tx.write(retval)
+ tx.close()
+ logger.info('\tdone')
+
+
+def processCiteEngineFile(file, filename, bool_docbook):
+ ''' process cite engines file and get a line of result
+
+ The top of a cite engine file should look like this:
+ #\DeclareLyXCiteEngine[LaTeX Packages]{CiteEngineName}
+ #DescriptionBegin
+ #...body of description...
+ #DescriptionEnd
+ We expect output:
+ "CiteEngineName" "filename" "CiteEngineType" "CiteFramework" "DefaultBiblio" "Description" "Packages"
+ '''
+ remods = re.compile(r'\DeclareLyXCiteEngine\s*(?:\[([^]]*?)\])?{(.*)}')
+ redbeg = re.compile(r'#+\s*DescriptionBegin\s*$')
+ redend = re.compile(r'#+\s*DescriptionEnd\s*$')
+ recet = re.compile(r'\s*CiteEngineType\s*(.*)')
+ redb = re.compile(r'\s*DefaultBiblio\s*(.*)')
+ resfm = re.compile(r'\s*CiteFramework\s*(.*)')
+
+ modname = desc = pkgs = cet = db = cfm = ""
+ readingDescription = False
+ descLines = []
+
+ for line in open(file).readlines():
+ if readingDescription:
+ 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 = redbeg.search(line)
+ if res != None:
+ readingDescription = True
+ continue
+ res = remods.search(line)
+ if res != None:
+ (pkgs, modname) = res.groups()
+ if pkgs == None:
+ pkgs = ""
+ else:
+ tmp = [s.strip() for s in pkgs.split(",")]
+ pkgs = ",".join(tmp)
+ continue
+ res = recet.search(line)
+ if res != None:
+ cet = res.group(1)
+ continue
+ res = redb.search(line)
+ if res != None:
+ db = res.group(1)
+ continue
+ res = resfm.search(line)
+ if res != None:
+ cfm = res.group(1)
+ continue
+
+ if modname == "":
+ logger.warning("Cite Engine File file without \DeclareLyXCiteEngine line. ")
+ return ""
+
+ if pkgs != "":
+ # this cite engine has some latex dependencies:
+ # append the dependencies to chkciteengines.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('chkciteengines.tex', 'a')
+ for line in testpackages:
+ cm.write(line + '\n')
+ cm.close()
+
+ return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, cet, cfm, db, desc, pkgs)
+
+
def checkTeXAllowSpaces():
''' Let's check whether spaces are allowed in TeX file names '''
tex_allows_spaces = 'false'
# Final clean-up
if not lyx_keep_temps:
removeFiles(['chkconfig.vars', 'chklatex.ltx', 'chklatex.log',
- 'chklayouts.tex', 'chkmodules.tex', 'missfont.log',
- 'wrap_chkconfig.ltx', 'wrap_chkconfig.log'])
+ 'chklayouts.tex', 'chkmodules.tex', 'chkciteengines.tex',
+ 'missfont.log', 'wrap_chkconfig.ltx', 'wrap_chkconfig.log'])
if __name__ == '__main__':
lyx_check_config = True
lyx_kpsewhich = True
outfile = 'lyxrc.defaults'
- lyxrc_fileformat = 20
+ lyxrc_fileformat = 21
rc_entries = ''
lyx_keep_temps = False
version_suffix = ''
if lyx_kpsewhich:
rescanTeXFiles()
checkModulesConfig()
+ checkCiteEnginesConfig()
# --without-latex-config can disable lyx_check_config
ret = checkLatexConfig(lyx_check_config and LATEX != '', bool_docbook)
removeTempFiles()