8 "nativeCallWithWrapperObjTagA": 1,
9 "nativeCallWithWrapperObjName":
u"TestName",
14 def nativeCall(a, b, localEnv):
15 localEnv[
"nativeCallTagA"] = a
16 localEnv[
"nativeCallTagB"] = b
19 def nativeWithWrapper(a, wrapObj, localEnv):
20 localEnv[
"nativeCallWithWrapperObjTagA"] = a
21 wrapObj.Name = localEnv[
"nativeCallWithWrapperObjName"]
22 localEnv[
"wrapObj"] = wrapObj
27 if localEnv[
"nativeCallTagA"] != 10
or localEnv[
"nativeCallTagB"] !=
"b":
29 print "Error: Incorrect native call for threading timer"
31 wrapTeapot = localEnv[
"wrapObj"]
32 if localEnv[
"nativeCallWithWrapperObjTagA"] != 10
or wrapTeapot
is None or wrapTeapot.Name != localEnv[
"nativeCallWithWrapperObjName"]:
34 print "Error: Incorrect native call with wrapper object for threading timer"
40 global nativeCallTagA, nativeCallTagB
41 global nativeCallWithWrapperObjTagA, wrapTeapot
43 wrapTeapot = pymxs.runtime.Teapot()
46 nativeCallTimer = threading.Timer(0.1, nativeCall, [10,
"b"], kwargs={
"localEnv": globalArgs})
47 nativeWithWrapperTimer = threading.Timer(0.1, nativeWithWrapper, kwargs={
48 "a": 10,
"wrapObj": wrapTeapot,
"localEnv": globalArgs})
50 nativeCallTimer.start()
51 nativeWithWrapperTimer.start()
54 print "threading timer success"
56 if __name__ ==
"__main__":