Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-18-2015, 02:20 PM   #16
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
IMHO, it's only fair to mention that the most sophisticated part of the plugin code wasn't written by me.
Well, if sophistication is the bar being set, I'm pretty sure I haven't written much Python code at all.
DiapDealer is offline   Reply With Quote
Old 07-04-2015, 03:17 PM   #17
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Is there a way to have the dropdown box showing sorted img-keys?

Ok that was easy

replace
Code:
        image['values'] = img_dic.keys()
with
Code:
        image['values'] = sorted(img_dic.keys())
Why is

Code:
        image['values'] = img_dic.keys().sort()
exporting an empty list?

Last edited by rubeus; 07-04-2015 at 03:36 PM.
rubeus is offline   Reply With Quote
Old 07-04-2015, 04:37 PM   #18
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,553
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by rubeus View Post
Why is

Code:
        image['values'] = img_dic.keys().sort()
exporting an empty list?
The sort() method of a list modifies the list in place, but returns None. To do what you want with the list method, you'd have to do something like:

Code:
image['values'] = img_dic.keys()
image['values'].sort()
print image['values']
The 'sort' list method was all that was available prior to Python 2.4. The builtin function 'sorted' (available from Python 2.4+) builds a new sorted list from any iterable--and is imminently handier most times--as you've no doubt discovered.

Code:
print sorted(img_dic.keys())

Last edited by DiapDealer; 07-05-2015 at 12:46 PM.
DiapDealer is offline   Reply With Quote
Old 07-05-2015, 12:20 AM   #19
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
Quote:
Originally Posted by DiapDealer View Post
The sort() method of a list modifies the list in place, but returns None.


rubeus is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help with text wrap... skammer1974 Sigil 3 03-06-2013 07:28 PM
TEXT WRAP AROUND IMAGES RKEP71 Sigil 1 06-20-2011 08:26 PM
Image wrap test Jellby ePub 15 05-04-2011 02:30 PM
LRF and wrap-around text Seabound Calibre 13 12-28-2008 03:30 PM


All times are GMT -4. The time now is 10:56 PM.


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