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 11-22-2010, 01:20 PM   #16
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by kovidgoyal View Post
In that case, the better approach is that rather than setting self.title, set self.timefmt.
So you propose to set self.title to "brand eins" and self.timefmt to "10/2010" for the october issue? What is the benefit of doing it this way?

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 11-22-2010, 01:44 PM   #17
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
it's far more semantic and the rest of the conversion pipeline can use the information as appropriate
kovidgoyal is offline   Reply With Quote
Advert
Old 11-23-2010, 06:33 AM   #18
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Ok, here is the patch against the latest checked-in version:

Code:
*** brand_eins_orig.recipe	Tue Nov 23 08:12:11 2010
--- brand_eins.recipe	Tue Nov 23 08:25:53 2010
***************
*** 91,98 ****
      latest_jahrgang = soup.findAll('div', attrs={'class': re.compile(r'\bjahrgang-latest\b') })[0].findAll('ul')[0]
      pre_latest_issue = latest_jahrgang.findAll('a')[len(latest_jahrgang.findAll('a'))-issue]
      url = pre_latest_issue.get('href', False)
!     # Get the title for the magazin - build it out of the title of the cover - take the issue and year;
!     self.title = "brand eins "+ re.search(r"(?P<date>\d\d\/\d\d\d\d)", pre_latest_issue.find('img').get('title', False)).group('date')
      url = 'http://brandeins.de/'+url
  
      # url = "http://www.brandeins.de/archiv/magazin/tierisch.html"
--- 91,100 ----
      latest_jahrgang = soup.findAll('div', attrs={'class': re.compile(r'\bjahrgang-latest\b') })[0].findAll('ul')[0]
      pre_latest_issue = latest_jahrgang.findAll('a')[len(latest_jahrgang.findAll('a'))-issue]
      url = pre_latest_issue.get('href', False)
!     # Magazin title
!     self.title = "brand eins"
!     # Get month and year of the magazine issue - build it out of the title of the cover
!     self.timefmt = " " + re.search(r"(?P<date>\d\d\/\d\d\d\d)", pre_latest_issue.find('img').get('title', False)).group('date')
      url = 'http://brandeins.de/'+url
  
      # url = "http://www.brandeins.de/archiv/magazin/tierisch.html"
Ciao,
Steffen
siebert is offline   Reply With Quote
Old 11-26-2010, 12:57 AM   #19
Consti
Junior Member
Consti began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2010
Device: Kindle
I've reverted Steffens changes until further notice.
I have to look in the changes.. sorry for including them so fast.

I am in Beijing right now, so I'll look into it as soon as I am back home.

@steffen: Sorry for reverting the changes. Lets talk about it as soon as I am back (should be in one week or so )
Consti is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
All recipes have Unknown author and title- From source Sept 30 Starson17 Calibre 22 10-03-2010 11:38 AM
Suggestion: USA recepit have date in title DBDigital Calibre 1 06-12-2010 01:33 PM
Removing date from periodical title elmoglick Calibre 2 06-06-2010 02:18 PM
Rename output Title of (custom) news source ischeriad Calibre 4 02-16-2010 06:14 AM
Date in Title when Fetching News Nigel H Calibre 1 01-13-2010 11:57 AM


All times are GMT -4. The time now is 04:26 AM.


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