Potential bug with the API?

Trying to call an object container with a callback, and as one of the parameters, having a list.....

 

But somehow the list doesn't make it over to the new function/container properly, cuz I can't loop the list.

 

Can however from the calling function

 

Anyone?

 

Sample:

 

        oc = ObjectContainer(no_cache=True)	
	try:
		sections = XML.ElementFromURL(PMS_URL).xpath('//Directory')	
		for section in sections:			
			title = section.get('title')
			key = section.get('key')
			paths = section.xpath('Location/@path')
			Log.Debug("Title of section is %s with a key of %s and a path of : %s" %(title, key, paths))	
			for path in paths:
				Log.Debug("Path is %s" %(path))
			oc.add(DirectoryObject(key=Callback(confirmScan, title=title, paths=paths, key=key), title='Look in section "' + title + '"'))	
	except:
		pass
	oc.add(PrefsObject(title='Preferences', thumb=R('icon-prefs.png')))
	Log.Debug("**********  Ending MainMenu  **********")
	return oc

 

/Tommy

Could be that the cerializer/de-cerializer is not re-creating the list in the second function. Try declaring the variable type in the @route decorator:

@route('/video/myplugin/functionb', variable_x=list)
def FunctionB(variable_x):
   ''' do stuff'''
   return

Could be that the cerializer/de-cerializer is not re-creating the list in the second function. Try declaring the variable type in the @route decorator:

@route('/video/myplugin/functionb', variable_x=list)
def FunctionB(variable_x):
   ''' do stuff'''
   return

I'll check it out in a couple of days..sadly busy for the next couple of ones....But FUI created a work-around with a nasty global array

Anyway....worth a shut, to huge thanks from my side regardless of the outcome

Best regards

Tommy

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.