Index: lib/scripts/elyxerbridge.py =================================================================== --- lib/scripts/elyxerbridge.py (revisión: 0) +++ lib/scripts/elyxerbridge.py (revisión: 0) @@ -0,0 +1,59 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + +# file elyxerbridge.py +# This file is part of LyX, the document processor. +# Licence details can be found in the file COPYING. + +# author Alex Fernandez (address@hidden) + +# Full author contact details are available in file CREDITS + +# Usage: +# elyxerbridge.py --directory + +# This script will convert the LyX file to , +# using eLyXer. If eLyXer is not present then an error will be recorded and +# shown to the user. + + +import sys +import os.path +try: + from elyxerconv import * +except: + print("Error: eLyXer not present") + exit() + +def readdir(filename, diroption): + "Read the current directory if needed" + if getattr(Options, diroption) != None: + return + setattr(Options, diroption, os.path.dirname(args[0])) + if getattr(Options, diroption) == '': + setattr(Options, diroption, '.') + +def convertdoc(args): + "Read a whole book, write it" + if len(args) != 2: + usage() + readdir(args[0], 'directory') + readdir(args[0], 'destdirectory') + filein = args[0] + del args[0] + fileout = args[0] + del args[0] + converter = eLyXerConverter(filein, fileout) + converter.convert() + +def usage(): + "Show usage message" + Trace.message('eLyXer Bridge error: must specify both origin and destination files.') + Trace.message(' usage: elyxerbridge --directory directory input.lyx output.html') + exit() + +args = sys.argv +del args[0] +Options().parseoptions(args) +convertdoc(args) + Cambios de propiedades en lib/scripts/elyxerbridge.py ___________________________________________________________________ Añadido: svn:executable + * Index: lib/configure.py =================================================================== --- lib/configure.py (revisión: 31391) +++ lib/configure.py (copia de trabajo) @@ -605,11 +605,23 @@ checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'], rc_entry = [ r'\converter word latex "%%" ""' ]) # - path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py', 'elyxer'], - rc_entry = [ r'\converter lyx html "python -tt $$s/scripts/elyxer.py --directory $$r $$i $$o" ""' ]) - if elyxer.find('elyxer') >= 0: - addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py -e html,png,jpg,jpeg,css $$i $$o"''') - else: + # eLyXer: search as a library (elyxerconv) and then as an executable (elyxer.py, elyxer) + elyxerfound = False + print '+checking for "eLyXer Converter"... ', + try: + import elyxerconv + addToRC(r'''\converter lyx html "$$s/scripts/elyxerbridge.py --directory $$r $$i $$o" ""''') + elyxerfound = True + print ' yes' + except ImportError: + print ' no' + path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py --directory $$r $$i $$o','elyxer --directory $$r $$i $$o'], + rc_entry = [ r'\converter lyx html "%%" ""' ]) + if elyxer.find('elyxer') >= 0: + addToRC(r'''\copier html "python -tt $$s/scripts/ext_copy.py -e html,png,jpg,jpeg,css $$i $$o"''') + elyxerfound = True + + if not elyxerfound: # On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/ path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 'htlatex.sh $$i', \ '/usr/share/tex4ht/htlatex $$i', 'tth -t -e2 -L$$b < $$i > $$o', \