Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-23-2012, 12:45 PM   #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, 03: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: 26,436
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Fixed. Thanks.
kovidgoyal is offline   Reply With Quote
 
Advertisement
Old 04-23-2012, 10: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: 26,436
Karma: 5383257
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, 03: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, 09:38 AM   #5
chaley
"chaley", not "charley"
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: 5,907
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
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
Reply

Tags
code, efficiency, formating, gui

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:59 PM
how to write calibre metadata to the book file in bulk? user105 Calibre 7 01-04-2012 06:21 AM
Remove Books anomaly? unboggling Calibre 31 10-24-2011 09:15 PM
strange dictionary anomaly (non-rooted) jswinden Nook Color & Nook Tablet 0 03-23-2011 07:02 PM
Classic Anomaly with Trook and Nook? jhempel24 Nook Developer's Corner 0 11-28-2010 01:19 PM


All times are GMT -4. The time now is 08:57 AM.


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