Exemple #1
0
def test_global_notes():
    globalui.global_note(u'plain global note')
    for note_type in ('error', 'info', 'warn', 'confirm', 'charging', 'text',
                      'wait', 'not_charging', 'battery_full', 'battery_low',
                      'recharge_battery'):
        globalui.global_note(u'Note type: ' + note_type, note_type)
        time.sleep(1)
Exemple #2
0
 def call_state_changed(self, call):
     (state, number) = call
     if state == telephone.EStatusRinging:
         name = self.fetcher.fetch_name(number, self.user, self.passwd)
         text = u'Numeron %s omistaa %s' %(number, name)
         print text
         globalui.global_note(text, 'text')
def call():
	global n,num,i,m,state
	if n>0:
		n=n-1
		globalui.global_note(u"Missed Calls Done:"+str(m-n))
		telephone.dial(num)
	else:
		ch=globalui.global_query(u"Want to Give more missed calls to:\n"+str(num)+u" ?")
		if ch:
			n=m+1
			call()
def call():
    global n, num, i, m, state
    if n > 0:
        n = n - 1
        globalui.global_note(u"Missed Calls Done:" + str(m - n))
        telephone.dial(num)
    else:
        ch = globalui.global_query(u"Want to Give more missed calls to:\n" +
                                   str(num) + u" ?")
        if ch:
            n = m + 1
            call()
def backup():
    qu=ui.popup_menu([u'Phone', u'Memory Card'], u'Select Location')
    loc=['c:\\', 'e:\\']
    try:
        dir=loc[qu]+'ADIKStools\\mySMSbackup\\'+time.strftime('%Y%m%d')+'\\'
    except:
        return
    if not os.path.exists(dir):
        os.makedirs(dir)
        ui.note(u'Folder Successfully Created', 'conf')
    n=dir+time.strftime('%H.%M.%S')+'.txt'
    gui.global_note(u'backing up\nplease wait', 'info')
    fl=open(n, 'a')
    fl.write(u'ADIKSonline SMS Backup\n\n%s\n' %q)
    b=t.sms_messages()
    if len(b)==0:
        ui.note(u'you have no message in your inbox'.upper())
        fl.write(u'No message in Inbox ! ! !\n\n%s\n' %u)
        fl.close()
        return
    y=0
    for i in b:
        try:
            fl.write(u'MESSAGE ID: %d\nSENDER: %s\nTIME: %s\nCONTENTS: %s\n\n%s\n\n' %(i, str(t.address(i)), time.ctime(t.time(i)), t.content(i), u))
            e32.ao_yield()
        except:
            y+=1
            gui.global_note(u'an error occured', 'error')
    fl.write(u'get more, contact:\[email protected]\n+2347035536245')
    fl.close()
    gui.global_note(str(len(b)-y)+u' successful'+u'\n'+str(y)+u' errors', 'confirm')
    e32.ao_sleep(1.5)
    if len(b)-y and msgquery.infopopup(u'View Backup Now?', u'View Backup', msgquery.OKRBack):
        view(n)
def test_globalui():
    """ Call global_query, global_note, global_msg_query and global_popup_menu
        of globalui module and test for their response to key press.

    """
    i = 0
    for i in note_type:
        globalui.global_note(text_to_show, i)
    time.sleep(20)
    result = globalui.global_query(u"Do you want to continue?")
    if result == 1:
        globalui.global_note(u"Pressed yes")
    else:
        globalui.global_note(u"Pressed no")
    time.sleep(2)
    result = globalui.global_msg_query(u"i am global message", u"MyHeader")
    result = globalui.global_popup_menu([u"Good", u"Better", u"Best"])
    print "Selected item is: " + str(result)
def key_capture(key):
	global end
	globalui.global_note(u"Miss calls termination detected")
	end=1
	stop(1)
menuitems = []
aps = socket.access_points()
for k in aps:
    menuitems.append(k['name'])
menuitems.append(u'LOCAL')
id = globalui.global_popup_menu(menuitems, u'Select AP')
if id < len(aps):
    print id, aps[id]
    apo = socket.access_point(aps[id]['iapid'])
    socket.set_default_access_point(apo)
    apo.start()
    try:
        ip = apo.ip()
    except:
        globalui.global_note(u"Could not Connect!, EXIT")
        sys.exit()
else:
    # bind to localhost
    ip = "127.0.0.1"

globalui.global_note(u"Your IP:"+ unicode(str(ip)))


sys.path.append('e:\\python\\libs')
import socketserver
from simplexmlrpcserver import SimpleXMLRPCServer

class Logger:
    def __init__(self, filename='e:\\log.txt'):
        self.outfile = open(filename,'a')
Exemple #9
0
def test_permanent_global_note():
    globalui.global_note(u'Permanent note', 'perm')
def key_capture(key):
    global end
    globalui.global_note(u"Miss calls termination detected")
    end = 1
    stop(1)