Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-23-2012, 11:45 AM   #1
Jesse Chisholm
Enthusiast
Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.
 
Jesse Chisholm's Avatar
 
Posts: 27
Karma: 56200
Join Date: Jul 2011
Location: California
Device: none
Anomaly in calibre.ebooks.metadata.book ?

I was perusing code to improve my understanding before I launched my next effort in writing a plugin.

I saw an anomaly (not a bug) in calibre.ebooks.metadata.book in base.py circa lines 653..656 in the method format_field_extended.

Lines 653..654 appear to be redundant to lines 657..658.
Line 655 appears to be redundant to line 659.
Line 656 appears to be redundant to line 651.

If my analysis is right, then removing 653..656 will save nano-seconds per month by avoiding the duplicate call to fetch cmeta.

-Jesse
Jesse Chisholm is offline   Reply With Quote
Old 04-23-2012, 02:18 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,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Fixed. Thanks.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-23-2012, 09:22 PM   #3
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,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
On second thoughts, I think I shall hold off changing this code and wait for chaley, who wrote it to comment. That code may be the way it is to deal with composite fields that refer to other composite fields.
kovidgoyal is offline   Reply With Quote
Old 04-27-2012, 02:39 AM   #4
Jesse Chisholm
Enthusiast
Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.Jesse Chisholm actually enjoys Vogon poetry.
 
Jesse Chisholm's Avatar
 
Posts: 27
Karma: 56200
Join Date: Jul 2011
Location: California
Device: none
Agreed - it is minor enough to hold off for more complete analysis.
And if it is that way for a reason, a comment stating the reason would prevent someone else later seeing the same thing and raising the same question later.
-Jesse
Jesse Chisholm is offline   Reply With Quote
Old 04-28-2012, 08:38 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
There is redundant code there, coming from merging two methods, adding composite fields, and some bug fixes.

Changes submitted.
chaley is offline   Reply With Quote
Advert
Reply

Tags
code, efficiency, formating, gui


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing Metadata book descriptions from Calibre? Avid Fan Amazon Kindle 5 02-29-2012 04:59 PM
how to write calibre metadata to the book file in bulk? user105 Calibre 7 01-04-2012 05:21 AM
Remove Books anomaly? unboggling Calibre 31 10-24-2011 08:15 PM
strange dictionary anomaly (non-rooted) jswinden Nook Color & Nook Tablet 0 03-23-2011 06:02 PM
Classic Anomaly with Trook and Nook? jhempel24 Nook Developer's Corner 0 11-28-2010 12:19 PM


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


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