johnsojc wrote:sdlName = <PlasmaTypes.ptAttribString instance at 0x18AE95A8>
sdlName.value = boolTreeDayLights
ageSDL = PtGetAgeSDL() (= <Plasma.ptSDL object at 0x1346F7D0>)
[..]
I do not understand what this is trying to do.
Okay, some explanations:
<PlasmaTypes.ptAttribString instance at 0x18AE95A8>
sdlName is in fact not a variable or a string directly, but sort of pointer to a struct (if we think C), containing the information.
"at 0x18AE95A8" says where it can be found in memory,
"PlasmaTypes.ptAttribString" tells which type it is (sort of string).
sdlName.value is a dereferenced access to this structure, giving the value (the string)
johnsojc wrote:so ageSDL[sdlName.value][0] would look like
<Plasma.ptSDL object at 0x1346F7D0>[boolTreeDayLights][0]
Hmm, better forget this. You can't access it this way, or translate it this way.
The Python interpreter just prints out something like "<Plasma.ptSDL object at 0x1346F7D0>" to show it's not directly an SDL value, but sort of reference to an SDL structure/object. Similar to what I said above.
Just working with "sdlName.value" to access it is fine and all we need to know.
Accessing the SDL value using
ageSDL[boolTreeDayLights][0]
gives you the real (current) value; that's the reason for the [0] at the end.
(I don't know what is contained in index [1] - if it even exists in the vault. Maybe it keeps the default values, which we define in the .SDL files - but don't count on that. I'm just guessing.)
Forgive me if I was trying to tell you what you already knew. Maybe I misunderstood what you did not understand. *g*
You do know how you can have a look into the SDL definitions directly? Or how to have a look into the vault to see which are available?
Edit:
johnsojc wrote:According to the code, ageSDL[sdlName.value][0] should return a bool value but appears to fail for some reason. Even the debug statements I put in the file to get what this code returns causes a traceback.
It can fail if there is really no such SDL variable to access. If that's the case, it is not a bug in the Python code, but in the SDL setup itself.
By the way, did you check if your real SDL setup has still
leading trailing spaces in their names?
(Not sure if an SDL database can hold whitespaces at all though. In my understanding, Adam's fix did only remove them from the max wiring interface / value passing from the Age file.)