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 06-22-2011, 06:13 PM   #31
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Thx for the debate on this guys. So to summarise the state of play as I understand it...
  • Find Duplicates can be easily sorted with Kovids additions today.
  • Count Pages and Modify ePub I should be able to change without drama.
  • With Extract ISBN there could be a large number of files to copy up front (if the user selects several thousand books as they have in the past it will result in many more thousands of book formats being copied up front) but it's the "right" thing to do anyway as a background job.
  • Quality Check could potentially be changed to use the SpooledTempFile approach since it runs in process. But will hold off making changes until the db API settles in case some other idea crops up
  • Open With remains a sticky problem, but again some bright idea may come in down the track.
kiwidude is offline   Reply With Quote
Old 06-22-2011, 06:40 PM   #32
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: 25,923
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Seems about right
kovidgoyal is online now   Reply With Quote
Old 06-22-2011, 07:38 PM   #33
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,786
Karma: 3973173
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
H-e-e-l-l-p-p! Most of this thread is completely over my head but the keyword cover(), from post #1 has made me reply rather than go get my duvet and sit under it singing la-la-lah-la-lah until it's all over

I have no idea whether my cosmetic Copy Cover plugin will be affected by your plans and I don't run from source to suck-it-and-see.

Please can someone help me figure out whether I need to do anything? I think the following info may be relevant.
  1. Plugin currently runs modally.
  2. It does not update any data in the calibre database but it does process multiple records (1-99) sequentially.
  3. I'm not aware of using a format() function.
  4. I'm not exactly sure what you mean by the cover() function but I do use the following code:
    Code:
    db = self.gui.library_view.model().db
    cover_path = db.cover(row, index_is_id=False, as_path=True)
    cover_data = db.cover(row, index_is_id=False, as_path=False)
  5. The cover_path is only used for testing existence of a cover. It is not used to copy the cover from calibre to device.
  6. Instead, the cover_data is used, in one of 2 ways depending on attached device:
    • - directly, using calibre function save_cover_data_to from calibre.utils.magick.draw
    • - indirectly by using an instance of the Image() class from calibre.utils.magick to load the cover_data followed by certain actions with the Image methods size and quantize. Image instance is then copied to device using save_cover_data_to.
  7. I use os.path quite a lot but (I think) always referring to files/folders on the device rather than in calibre. I can check more carefully if necessary.

Now, do I need to get the duvet?
jackie_w is offline   Reply With Quote
Old 06-22-2011, 07:51 PM   #34
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: 25,923
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You're fine, the only difference for you is that every time you use cover(..., as_path=True) a temp file is created and the cover is copied to it. The tempfile is automatically deleted when you close calibre.

I would suggest that you use a single call to both get the cover data and test for its existence, like this:

Code:
cover_data = db.cover(row, index_is_id=False, as_path=False)
if cover_data is None:
   # no cover present
else:
   # cover present
And let me emphasize that the changes should not break any existing plugins. The worst that will happen is that a plugin will run slower and create lots of temp files.
kovidgoyal is online now   Reply With Quote
Old 06-22-2011, 08:07 PM   #35
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,786
Karma: 3973173
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
Well, that's made me feel a bit more relaxed

I should obviously have coded it that way to begin with. Do you advise me to do a new release just to make that change or can I leave it until I actually have a new feature to offer (if ever).
jackie_w is offline   Reply With Quote
Old 06-22-2011, 08:29 PM   #36
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: 25,923
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It's up to you, if you are the type that cannot live with the creation of all those extra temp files on all your users computers, then make an updated release.

If I were you, I would make an updated release, but then, I have a disease, just look at the number of calibre releases there are...
kovidgoyal is online now   Reply With Quote
Old 06-22-2011, 08:35 PM   #37
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,224
Karma: 1334002
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Luckily I don't have that disease. I can go months without releasing.
kiwidude is offline   Reply With Quote
Old 06-22-2011, 08:40 PM   #38
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,786
Karma: 3973173
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"
Long may you be thus afflicted.

OK, boss, I'll get it sorted. I've been interested to see the number of my plugin downloads rocket since you released v0.8.6. About 10/day before, about 100/day since. Presumably, not a coincidence as I haven't added any functionality.
jackie_w is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The behavior of Apple leebase General Discussions 30 03-17-2011 12:01 AM
strange behavior zeroh Nook Color & Nook Tablet 3 12-09-2010 11:14 AM
strange behavior valb2953 Calibre 1 11-22-2010 01:12 PM
Tag behavior... guyanonymous Calibre 1 11-29-2009 02:57 PM


All times are GMT -4. The time now is 02:28 PM.


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