View Single Post
Old 09-18-2009, 09:21 AM   #1
frabjous
Wizard
frabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterfrabjous can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
frabjous's Avatar
 
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
Problem with converting very simple HTML file with table

Using calibre 0.6.12 for linux on Ubuntu 9.04 32-bit.

I tried using the commandline:

Code:
ebook-convert test.html test.txt
on the following very very simple html file:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>test table</title>
</head>
<body>
<table>
<tr><td>Upper Left</td><td>Upper Right</td></tr>
<tr><td>Lower Left</td><td>Lower Right</td></tr>
</table>
</body>
</html>
ebook-convert hangs at "Building file list...". When I finally get sick of waiting, and hit ctrl-c, it dumps the following (if this means anything to you):

Code:
Traceback (most recent call last):
  File "/tmp/init.py", line 47, in <module>
  File "/home/kovid/build/calibre/src/calibre/ebooks/conversion/cli.py", line 249, in main
  File "/home/kovid/build/calibre/src/calibre/ebooks/conversion/plumber.py", line 717, in run
  File "/home/kovid/build/calibre/src/calibre/customize/conversion.py", line 208, in __call__
  File "/home/kovid/build/calibre/src/calibre/ebooks/html/input.py", line 285, in convert
  File "/home/kovid/build/calibre/src/calibre/ebooks/html/input.py", line 336, in create_oebbook
  File "/home/kovid/build/calibre/src/calibre/ebooks/oeb/base.py", line 409, in __init__
  File "/home/kovid/build/calibre/src/calibre/ebooks/oeb/base.py", line 437, in namelist
  File "/usr/lib/python2.6/os.py", line 294, in walk
    for x in walk(path, topdown, onerror, followlinks):
  File "/usr/lib/python2.6/os.py", line 294, in walk
    for x in walk(path, topdown, onerror, followlinks):
  File "/usr/lib/python2.6/os.py", line 294, in walk
    for x in walk(path, topdown, onerror, followlinks):
  File "/usr/lib/python2.6/os.py", line 284, in walk
    if isdir(join(top, name)):
  File "/usr/lib/python2.6/genericpath.py", line 41, in isdir
    st = os.stat(s)
KeyboardInterrupt
I have similar trouble trying to convert the above HTML file to other formats.

Anyway, why was I bothering converting such a pitiful little file? Well, I was trying to diagnose another problem I was having with ebook-convert when converting either HTML or ePub to plain text. In particular, it wasn't putting in a linefeed between rows of a table, unless I used the --linearize-tables option. However, then it puts in linefeeds even between columns in the same row. Thus, assuming the above file had worked at all, without ---linearize-tables, I would have got:

Code:
Upper LeftUpper RightLower LeftLower Right
with --linearize-tables I get:
Code:
Upper Left

Upper Right

Lower Left

Lower Right
What I would have liked to get, however, is something like:

Code:
Upper left Upper right

Lower left Lower right
...with either spaces or tabs between the columns in each row (--I'm not too picky about this, but there should be something--), and linefeeds (one or two) between the rows.

Last edited by frabjous; 09-18-2009 at 09:23 AM.
frabjous is offline   Reply With Quote