View Single Post
Old 09-06-2010, 10:55 AM   #2657
TonytheBookworm
Addict
TonytheBookworm is on a distinguished road
 
TonytheBookworm's Avatar
 
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
Quote:
Originally Posted by poloman View Post
TonytheBookworm - sorry for sounding stupid, but in the code for TheDailyMash where you have print statements - where does it print to? I can't see an output anywhere when Calibre is running - is it piped to a file, or does it flash by in the current job status screen?


ps - i used this to get rid of the links at the end of the articles - can probably bin the 'object' and other tags, but it works and I'm (slowly) learning!

remove_tags = [
dict(name=['object','link','script','span','iframe','hr'])
,dict(name='a', attrs={'alt':['Digg!','StumbleUpon!','Reddit!','Facebook!']})
,dict(name='a', attrs={'title':['Digg!','StumbleUpon!','Reddit!','Facebook!']})
]
I'm just now learning the stuff myself too as for the print statements that is a neat little trick Starson17 introduced to me. What you do is when building your recipes you use the following command line.
c:\Program Files\Calibre2>ebook-convert recipenamehere.recipe output_dir --test -vv > myrecipe.txt

so when you run that and you have for instance
print 'HERE IS WHAT WILL PRINT: ', print_url

then it will take and output to the file myrecipe.txt what the print_url is and you can find it easily in the log by looking for HERE IS WHAT WILL PRINT. It keeps you from having to guess per say.
TonytheBookworm is offline