Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-07-2016, 05:52 AM   #16
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
The list of file types calibre adds is based on a user preference, the logic for getting that list is

Code:
        if gprefs['auto_add_everything']:
            self.allowed = AllAllowed()
        else:
            self.allowed = AUTO_ADDED - frozenset(gprefs['blocked_auto_formats'])
OK. That's somewhat less obvious than either I or eschwartz figured.
Phssthpok is offline   Reply With Quote
Old 01-07-2016, 06:04 AM   #17
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by eschwartz View Post
With the extra (wasted?) stat calls, you might actually lose time. I'm not sure if os.stat is faster than os.chmod, if not then you always lose.
My off-the-cuff guess would be that there won't be much difference since each disk block of a directory will contain several entries, so several directory updates will typically translate into a single disk write later on, which will be the main efficiency consideration. So yes, it sounds to me like an "always-lose" situation.

Last edited by Phssthpok; 01-07-2016 at 06:06 AM.
Phssthpok is offline   Reply With Quote
Advert
Old 01-07-2016, 06:31 AM   #18
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
The list of file types calibre adds is based on a user preference, the logic for getting that list is

Code:
        if gprefs['auto_add_everything']:
            self.allowed = AllAllowed()
        else:
            self.allowed = AUTO_ADDED - frozenset(gprefs['blocked_auto_formats'])
And here we go again:
Attached Files
File Type: zip autoadd_unblocker_1-0-3.zip (2.0 KB, 288 views)
Phssthpok is offline   Reply With Quote
Old 01-07-2016, 10:19 AM   #19
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Phssthpok View Post
OK. That's somewhat less obvious than either I or eschwartz figured.
In self-defense I wrote all that from the hacked browser on my 6" Kindle Touch.
I figured there was probably an even better way, but without memorizing it beforehand... meh, it's enough to get the juice flowing.

(Yes, it is cramping my style a bit. )
eschwartz is offline   Reply With Quote
Old 01-09-2016, 10:19 AM   #20
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
The list of file types calibre adds is based on a user preference, the logic for getting that list is

Code:
        if gprefs['auto_add_everything']:
            self.allowed = AllAllowed()
        else:
            self.allowed = AUTO_ADDED - frozenset(gprefs['blocked_auto_formats'])
Kovid,
Perhaps if you have a spare minute you could encapsulate this in a method that I (or anyone else who might need it) can use, to avoid having to duplicate your code?

Thanks!
Phssthpok is offline   Reply With Quote
Advert
Old 01-09-2016, 10:36 AM   #21
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
https://github.com/kovidgoyal/calibr...58e07734260c83
kovidgoyal is offline   Reply With Quote
Old 01-16-2016, 10:31 AM   #22
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
Thanks, as usual!

For anyone who cares:
Attached Files
File Type: zip autoadd-unblocker_1-0-4.zip (1.7 KB, 292 views)

Last edited by Phssthpok; 01-17-2016 at 03:01 AM.
Phssthpok is offline   Reply With Quote
Reply

Tags
thread that never ends


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-T1 Help needed from users running the latest 1.0.07 firmware muse Sony Reader Dev Corner 7 08-28-2018 01:59 AM
UnicodeWarning when running Sigil plugin turbulent Plugins 9 12-17-2014 07:11 AM
Advice needed leeway63 General Discussions 23 12-30-2010 02:49 PM
Apps running in the background devseev enTourage Archive 14 10-25-2010 04:24 AM
apps running in background? kejia Spring Design Alex 0 05-13-2010 03:55 PM


All times are GMT -4. The time now is 06:27 AM.


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