Settings help

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kricker Offline
Team-XBMC QA Specialist
Posts: 3,549
Joined: Apr 2004
Reputation: 20
Location: Knoxville, TN
Post: #1
If I have the setting:
Code:
<setting id="refresh_queue" type="enum" label="30019" values="2|5|10|15|30" default="3"/>
In the settings file you get either 0,1,2,3,4. How can these be translated back to the values 2,5,10,15,30 for use in the addon python code? Is there a way to store these values in the setting file as 2,5,10,15,30 instead of 0,1,2,3,4 for easy retrieval?

Read this before using these builds.
XBMC win32 SVN builds
Changelog
find quote
giftie Offline
Skilled Python Coder
Posts: 2,364
Joined: Mar 2010
Reputation: 54
Location: Calgary, Alberta
Post: #2
How about using a list in python:

a = [2, 5, 10, 15, 30] <-inside your python program.

then testing from you setting value: a[setting]
to get the setting your wanted setting.
find quote
kricker Offline
Team-XBMC QA Specialist
Posts: 3,549
Joined: Apr 2004
Reputation: 20
Location: Knoxville, TN
Post: #3
Thanks, but I got the answer I was hoping for from Amet. Use labelenum instead of just enum. Then I can store the actual values instead of the iteration of enum.

Read this before using these builds.
XBMC win32 SVN builds
Changelog
find quote