Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 01-31-2011, 04:26 PM   #1
Big Al
Junior Member
Big Al began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2011
Device: Kindle
How to cancel 'book' generation if no articles found

I have several recipes customised to only download articles from the last day. The trouble is I end up with 'books' with no content as not all blogs get posts every day.

Is there a way to get the recipe to 'cancel' if no articles / new articles are found?

Or is there an alternative approach? I suspect I have missed something obvious somewhere as this would seem a common requirement to me.

Regards,
Alan
Big Al is offline   Reply With Quote
Old 01-31-2011, 05:41 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: 45,363
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Override the parse_feeds method and raise an exception when no articles are present.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-31-2011, 06:52 PM   #3
Big Al
Junior Member
Big Al began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2011
Device: Kindle
After a quick spot of Python training I have implemented the above and it does work (of course;-) but it does leave a nasty error dialog on the screen instead of exiting gracefully.

Is there anything I can do to make this more graceful? Please excuse my lack of Python knowledge if this is what is holding me back from realising the answer.
Big Al is offline   Reply With Quote
Old 01-31-2011, 07:13 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: 45,363
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, there isn't.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
E-book device (E Ink, 2nd-generation) comparison matrix Alexander Turcic Which one should I buy? 107 11-16-2011 04:03 AM
Digital Content Production and Instant Multiple Book Format Generation Solution Munish News 0 05-18-2010 07:59 AM
Free e-book: My Digital Generation Bob Russell Deals and Resources (No Self-Promotion or Affiliate Links) 7 02-16-2008 10:39 AM
Found via Teleread.org: Two Articles abotu the Iliad CommanderROR iRex 5 04-18-2006 10:18 AM
Next generation e-book hardware by Microsoft? Alexander Turcic News 3 04-15-2005 08:50 PM


All times are GMT -4. The time now is 05:23 AM.


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