Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
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
Old 09-18-2009, 12:52 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Worked for me in under 3 seconds. try creating an empty directory, putting test.html in it and then running ebook-convert, the problem seems to be some sort of infinite link loop in the directory in which you've put test.html
kovidgoyal is offline   Reply With Quote
Advert
Old 09-18-2009, 02:15 PM   #3
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
OK, that helps... although should it really matter if that file has no links in it?

Still, I get:

Code:
Upper LeftUpper RightLower LeftLower Right
Or, if using --linearize-tables

Code:
Upper Left

Upper Right





Lower Left

Lower Right
Is there a way to get:
Quote:
Upper Left Upper Right

Lower Left Lower Right
?

I suppose I could preprocess my files with some sed scripts, but I'd think for ebook conversion, putting one row of a table per line of text would make sense.

Last edited by frabjous; 09-18-2009 at 02:19 PM.
frabjous is offline   Reply With Quote
Old 09-18-2009, 02:36 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Open a ticket for it and user_none (who wrote the TXT output, will comment)

the links in question are file system links not links in the file.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of Contents - html to Mobi problem thames Calibre 3 06-02-2010 07:24 PM
Need help converting file which is too long to be HTML ficbot Workshop 8 04-06-2010 11:45 PM
Small HTML file won't finish converting AlexBell Calibre 2 07-06-2009 06:15 AM
Problem converting HTML to Mobi AprilHare Calibre 3 05-02-2009 09:34 PM
converting lit html output into one big file for BD Dave Berk Sony Reader 15 03-29-2007 10:02 PM


All times are GMT -4. The time now is 02:34 PM.


MobileRead.com is a privately owned, operated and funded community.