DocBook to ePub

Stephan Witt st.witt at gmx.net
Sat Feb 6 22:35:43 UTC 2021


Am 06.02.2021 um 15:10 schrieb Pavel Sanda <sanda at lyx.org>:
> 
> On Sat, Feb 06, 2021 at 02:49:04PM +0100, Pavel Sanda wrote:
>> Command to execute:
>> "java" -jar "/home/lyx/lyx/devel/lib/scripts/../scripts/saxon6.5.5.jar" Intro.xml /home/lyx/lyx/devel/lib/scripts/../docbook/epub3/chunk.xsl base.dir=/tmp/tmpnc1DfX
>> docbook2epub fails
>> sh: 1: java -jar /home/lyx/lyx/devel/lib/scripts/../scripts/saxon6.5.5.jar Intro.xml /home/lyx/lyx/devel/lib/scripts/../docbook/epub3/chunk.xsl base.dir=/tmp/tmpnc1DfX: not found
>> Systemcall.cpp (291): Systemcall: 'python "/home/lyx/lyx/devel/lib/scripts/docbook2epub.py" "java" "Intro.xml" "Intro.epub"' finished with exit code 1
>> Error: Cannot convert file
>> 
>> Not sure what went wrong, but going to terminal I do not see /tmp/tmpnc1DfX created.
>> Manually creating and running the java command leads to:
> 
> The problem is not nonexistent dir, but qoutation for command, that's fixed by
> -    if os.system('"' + command + '"') != 0:
> +    if os.system(command) != 0:
> 
> Now it continues by:
> Command to execute:
> "java" -jar "/home/lyx/lyx/devel/lib/scripts/../scripts/saxon6.5.5.jar" Intro.xml /home/lyx/lyx/devel/lib/scripts/../docbook/epub3/chunk.xsl base.dir=/tmp/tmp31wRYV
> Generated ePub contents.
> Writing /tmp/tmp31wRYV/OEBPS/toc.ncx for article
> Traceback (most recent call last):
>  File "/home/lyx/lyx/devel/lib/scripts/docbook2epub.py", line 61, in <module>
>    for file in glob.glob(output_dir + '/**/*', recursive=True):
> TypeError: glob() got an unexpected keyword argument 'recursive'
> Systemcall.cpp (291): Systemcall: 'python "/home/lyx/lyx/devel/lib/scripts/docbook2epub.py" "java" "Intro.xml" "Intro.epub"' finished with exit code 1
> Error: Cannot convert file
> 
> I am not pythonist, so I leave an unexpected keyword argument 'recursive' to someone else. 

Thank you Pavel for exploring the first hurdles. I’m successful with your help on Mac with the attached patch. This works with python 2.7.16.

Stephan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: docbook2epub.patch
Type: application/octet-stream
Size: 2007 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210206/afc168a1/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Intro.epub
Type: application/epub+zip
Size: 55470 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210206/afc168a1/attachment-0001.epub>


More information about the lyx-devel mailing list