#------------------------------------ # PSSC: PhoneScreenSequentialCapture #------------------------------------ # (C) 2007 Michele Andreoli # pssc_push.py: the phone part # push screenshot towards the linux python client pssc.py import e32,sys,time,appuifw import series60_console my_console = series60_console.Console() appuifw.app.body = my_console.text sys.stderr = sys.stdout = my_console from stream import Stream from graphics import screenshot image="e:\\Images\\phone.jpg" running=1 def send_screenshot(): global s img=screenshot() img.save(image) s.sendfile(image) print "%s image sent. (%s)" % (str(img.size),time.ctime()) appuifw.app.title=u'PSSC' print "PSSC" print "(C) M. Andreoli" s=Stream(mode='BT') s.connect(service='PSSC') appuifw.note(u'connected!','info') size=appuifw.app.layout(appuifw.EScreen)[0] s.write("%s,%s"%size) # send size info to the client while running: data=s.read() if data=='SCREEN': send_screenshot() elif data=='END': running=0 e32.ao_yield() s.close() print "finish" # End