View Single Post
Old 01-21-2011, 05:48 PM   #1
petdr
Junior Member
petdr began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2011
Device: Kindle
Fixing exception in the_age recipe

I've got calibre 0.7.12 installed in ubuntu 8.04 LTS.

It has a recipe for The Age. However this recipe doesn't find the last feed, Columns, when processing www.theage.com.au/text.

So I added the following line to the section that processes the feeds

Code:
	if feed is not None:
	    if articles:
		feeds.append((feed, articles))
which says at the end if we still have a feed and articles add it to all the feeds at the end of processing.

You can find the whole script at http://pastie.org/1485719.

However now when I run this script I get the following error

Code:
Traceback (most recent call last):
  File "/usr/bin/ebook-convert", line 19, in <module>
    sys.exit(main())
  File "/usr/lib/calibre/calibre/ebooks/conversion/cli.py", line 254, in main
    plumber.run()
  File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 824, in run
    self.input_plugin)
  File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 951, in create_oebbook
    reader()(oeb, path_or_stream)
  File "/usr/lib/calibre/calibre/ebooks/oeb/reader.py", line 72, in __call__
    self._all_from_opf(opf)
  File "/usr/lib/calibre/calibre/ebooks/oeb/reader.py", line 593, in _all_from_opf
    self._manifest_from_opf(opf)
  File "/usr/lib/calibre/calibre/ebooks/oeb/reader.py", line 243, in _manifest_from_opf
    self._manifest_add_missing(invalid)
  File "/usr/lib/calibre/calibre/ebooks/oeb/reader.py", line 187, in _manifest_add_missing
    for url in cssutils.getUrls(item.data):
  File "/usr/lib/python2.6/dist-packages/cssutils/__init__.py", line 246, in getUrls
    u = getUrl(item)
  File "/usr/lib/python2.6/dist-packages/cssutils/__init__.py", line 229, in getUrl
    v.CSS_URI == v.primitiveType:
  File "/usr/lib/python2.6/dist-packages/cssutils/css/cssvalue.py", line 554, in _getPrimitiveType
    self.__set_primitiveType()
  File "/usr/lib/python2.6/dist-packages/cssutils/css/cssvalue.py", line 544, in __set_primitiveType
    val, type_ = self._value
AttributeError: 'CSSPrimitiveValue' object has no attribute '_value'
petdr is offline   Reply With Quote