View Single Post
Old 03-10-2014, 04:01 PM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
Code:
from calibre.ptempfile import TemporaryDirectory

with TemporaryDirectory('xxx') as tdir:
   for x in ('one.jpg', 'two.jpg'):
      with open(os.path.join(tdir, x) as f:
         f.write(get_resources('images/' + x))
    about.exec_()
Thanks, make that:

Code:
with open(os.path.join(tdir, x),'w') as f:


A minor, probably trivial question: How can I access the "version" defined in __init__ (or "name", or "author"...) from elsewhere inside the plugin code?
Jellby is offline   Reply With Quote