| Reply | « Previous Thread | Next Thread » |
|
Pymbian http://pymbian.sourceforge.net/ is designed to be a pedagogical device, helping to understand underlying principles of Symbian OS. It enables programmer to use regular Python to implement prototypes using Symbian C++ programming paradigms.
Specially, it models following features of Symbian OS: * Threads, Timers, Semaphores * Low-level asynchronous services (thread request semaphores, request status signaling & waiting, etc) * High-level asynchronous service (active schedulers and active objects) * client/server framework download : http://sourceforge.net/project/showf...roup_id=143316 source example : This source file shows how Active Scheduler, Active Object and platform timer service is used: Code:
import sys
import thread
import time
from pymbian.base import CActiveScheduler, CActive
from pymbian.std import KErrNone, User, RThread, KRequestPending, RTimer
from pymbian.std import KErrCancel
def do_example():
print "starting example"
scheduler = CActiveScheduler()
CActiveScheduler.Install(scheduler)
ao = TestAO()
ao.IssueRequest()
scheduler.Start()
print "closing down example"
class TestAO(CActive):
def __init__(self):
CActive.__init__(self)
CActiveScheduler.Add(self)
self.service = RTimer()
def IssueRequest(self):
print "issuing request for 1 sec delay"
self.service.After(self.iStatus, 1)
self.SetActive()
def Run(self):
print "TestAO.Run called"
print "closing down activescheduler"
CActiveScheduler.Stop()
def DoCancel(self):
self.service.Cancel()
def main():
do_example()
if __name__ == "__main__":
main()
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |