thanks massimo:
i still get errors here my model:
import time
from naoqi import ALBroker
from naoqi import ALProxy
broker = session.broker
behaviorProxy = session.behaviorProxy
ttsProxy = session.ttsProxy
motionProxy = session.motionProxy
testvariable = session.testvariable
def connectRobo(roboip):
RoboIP = roboip
RoboPORT = 9559
BrokerIP = "127.0.0.1"
BrokerPORT = 9999
session.broker =
ALBroker("pythonBroker",BrokerIP,BrokerPORT,RoboIP,RoboPORT)
session.ttsProxy= ALProxy ("ALTextToSpeech")
session.ttsProxy.setVolume(1.0)
session.ttsProxy.setLanguage("English")
session.ttsProxy.setVoice("Heather22Enhanced")
session.behaviorProxy = ALProxy ("ALBehaviorManager")
session.motionProxy= ALProxy("ALMotion")
stiffnesses = 1.0
session.motionProxy.setStiffnesses('Body', stiffnesses)
leftArmEnable = True
rightArmEnable = True
session.motionProxy.setWalkArmsEnable(leftArmEnable,
rightArmEnable)
return None
in the first controller:
def startConnection():
connect = connectRobo(request.vars.iptext)
#testingfunction()
print(request.vars.iptext)
return None
in the second controller:
def automatic_control():
if auth.is_logged_in():
aktsession=auth.user.id
userfirstname=auth.user.first_name
userlastname=auth.user.last_name
behaviours = behaviorProxy.getInstalledBehaviors()
return dict(session=aktsession, firstname=userfirstname,
lastname=userlastname, behaviours=behaviours)
redirect(URL(r=request,c='default/user',f='login'))
i get the error:
POST http://127.0.0.1:8000/NetAVATAR_neu/roboconnect/startConnection
500 INTERNAL SERVER ERROR
1.28s
On 30 Jun., 15:12, mdipierro <[email protected]> wrote:
> I think you want a session variable, not a global variable
>
> test=session.test
>
> def changingtest():
> session.test = 5
> return None
>
> On 30 Giu, 07:42, pk <[email protected]> wrote:
>
> > hi together,
>
> > i need help to solve this problem: i have a global variable in the
> > model like:
>
> > test = None
>
> > def changingtest():
> > global test
> > test = 5
> > return None
>
> > how can i access to the variable test in every controllerfunction?
> > thanks for your fast help
>
> > peter