Hello
I have a script that lets the user select a services from a list. When selected, an instance of a "ServiceHandler" class is created, which does the service interaction.
When the user is done interacting with the service, i should be able to press exit and return to the selection menu.
The first part looks like this
This is the handlerCode:def user_select_service(sevices): selection_list=create_list(services) appuifw.app.body=selection_list appuifw.app.title=u'Select a service' def returnToSelection(): appuifw.app.body=selection_list appuifw.app.title=u'Select a service' servicelist=get_services() service=user_select_service(servicelist) sh=ServiceHandler(service)
Code:class ServiceHandler: def __init__(self,service): #blablabla appuifw.app.exit_key_handler=self.goBack def goBack(self): DESTROY SELF returnToSelection() #a list of methods for interaction with the service #.... #...
I'm in doubt how to make my goBack method. I'm unsure of how to refere to methods (and variable) outside the class i'm in. And also, how to destroy the class i'm operating within. What would you do?

Reply With Quote

