Lines 111??“120
are created based on the generator de?¬?nition shown in Listing 8.3. Lines 113??“115
de?¬?ne the global variables so that the text message function can access data entered
in the design. Line 119 calls the imported SMS module and its sms_send function.
Parameters to the function, recipient number, message keyword, and content,
are taken from the model and the generator takes care of forming the right
message syntax. After all, it is always the same and is now de?¬?ned just once in the
generator.
The rest of the code is almost the same for all applications. Application stop (lines
122??“126) is taken from the Stop state using the unique function name given by the
generator as entering separate names in models for the Stop or Start states would just
add extra modeling work.
66 # Opens the specified file
67 appuifw.app.content_handler = appuifw.Content_handler
(lock.signal)
68 appuifw.app.content_handler.open
http://www.dsmforum.org/events/DSM06")
") (u"
69 lock.wait()
70
71 def Choice_list():
72 # Popup menu Please choose
73 choices3_2520 = [u"Registration", u"Program", u"Unregister"]
74 index = appuifw.popup_menu(choices3_2520, u"Please choose")
75 if index == None:
76 return ((call_stack.pop()), False)
77 elif choices3_2520[index] == u"Program":
78 return (SetForm, True)
79 elif choices3_2520[index] == u"Registration":
80 return (Query3_1481, True)
81 elif choices3_2520[index] == u"Unregister":
82 return (Query3_6300, True)
182 MOBILE PHONE APPLICATIONS USING A PYTHON FRAMEWORK
Listing 8.
Pages:
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340