Example #1
0
    def sendSysinfo(self,  full):
        self.send(NUM_SYSINFO_REPLY_START)
        self.send(NUM_SYSINFO_REPLY_LINE, "program_version", VERSION)
        self.send(NUM_SYSINFO_REPLY_LINE, "battery", sysinfo.battery())
        self.send(NUM_SYSINFO_REPLY_LINE, "active_profile", sysinfo.active_profile())
        self.send(NUM_SYSINFO_REPLY_LINE, "free_ram", sysinfo.free_ram())
        self.send(NUM_SYSINFO_REPLY_LINE, "pys60_version", e32.pys60_version)

        if sysinfo.active_profile() == u"offline":
            # Return an error code if the phone is in offline mode
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_dbm", -1)
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_bars", -1)
        else:
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_dbm", sysinfo.signal_dbm())
            self.send(NUM_SYSINFO_REPLY_LINE, "signal_bars", sysinfo.signal_bars())

        for drive,  free in sysinfo.free_drivespace().iteritems():
            self.send(NUM_SYSINFO_REPLY_LINE, "free_drivespace", str(drive) + str(free))

        if full:
            self.send(NUM_SYSINFO_REPLY_LINE, "display", str(sysinfo.display_pixels()[0]) + "x" + str(sysinfo.display_pixels()[1]))
            self.send(NUM_SYSINFO_REPLY_LINE, "imei", sysinfo.imei())
            self.send(NUM_SYSINFO_REPLY_LINE, "model", sysinfo.sw_version())
            self.send(NUM_SYSINFO_REPLY_LINE, "s60_version", e32.s60_version_info[0],  e32.s60_version_info[1] )
            self.send(NUM_SYSINFO_REPLY_LINE, "total_ram", sysinfo.total_ram())
            self.send(NUM_SYSINFO_REPLY_LINE, "total_rom", sysinfo.total_rom())

        self.send(NUM_SYSINFO_REPLY_END)
Example #2
0
def send_msg():
    txt = appuifw2.app.body.get()
    opt=globalui.global_popup_menu([u'From Contacts',u'Enter Manually'],u'Choose Number')
    if opt==1:
        num = appuifw2.query(u'Type the Number', 'float')
        try:
            num=int(num)
        except:
            return None
    elif opt==0:
        nam=appuifw2.query(u'Type the Name','text')
        con=contacts.ContactsDb()
        ls=con.find(nam)
        lst=[]
        try:
            for i in ls:
               lst.append(i.title)
            lst.sort()
            se=appuifw2.selection_list(lst,True)
            num=ls[se][0].value
        except:
            return None
    try:
        if num==None:
            return None
        else:
            pro = sysinfo.active_profile()
            if pro == 'offline' : 
                globalui.global_note(u'Phone in Offline profile! Message will be sent later.', 'warn')
            else:
                net = sysinfo.signal_bars()
                if net == 0 : 
                    globalui.global_note(u'No signal! Message will be sent later.', 'warn')
                pass
            m=messaging.sms_send(num, txt)
            globalui.global_note(u'Message Submitted succesfully', 'confirm')
    except:
        return None
Example #3
0
import sysinfo


str =  "Active Profile: "+ sysinfo.active_profile()
str += "\nBattery Info: "+ sysinfo.battery()    #battery information in symbian 
str += "\nDisplay Info: "+ sysinfo.display_pixels()
str += "\nFree Space: "   + sysinfo.free_drivespace()
str += "\nRAM(F/T): " + str(sysinfo.free_ram()/(1024.0*1024.0)) +"/"+ str(sysinfo.total_ram()/(1024.0*1024.0))
str += "\nIMEI: "+ sysinfo.imei()

Example #4
0
import sysinfo, appuifw, e32
#sysinfo是与系统信息有关的模块


def cn(x):
    return x.decode("utf8")


appuifw.app.body = t = appuifw.Text()
t.focus = False
appuifw.app.screen = "full"

t.add(cn("情景模式:") + sysinfo.active_profile())  #查看当前情景模式
t.add(cn("\n电量:") + unicode(sysinfo.battery()))  #查看当前电量
t.add(cn("\n屏幕分辨率:") + unicode(sysinfo.display_pixels()))  #查看屏幕分辨率
t.add(cn("\n剩余空间:\n"))
i = 0
drive = [u"C:", u"D:", u"E:"]
while i < len(drive):  #循环语句
    t.add(drive[i] + unicode(sysinfo.free_drivespace()[drive[i]] / 1024) +
          u"kb\n")  #查看C,D,E盘剩余空间
    i += 1
t.add(cn("剩余运存:") + unicode(sysinfo.free_ram() / 1024) + u"kb")  #查看剩余运存
t.add(cn("\nIMEI:") + unicode(sysinfo.imei()))  #查看手机串号
t.add(cn("\n系统版本:") + unicode(sysinfo.os_version()))  #查看系统版本信息
t.add(cn("\n响铃方式:") + unicode(sysinfo.ring_type()))  #查看响铃方式
t.add(cn("\n手机版本:") + unicode(sysinfo.sw_version()))  #查看手机版本
t.add(cn("\n缓存总大小:") + unicode(sysinfo.total_ram() / 1024) + u"kb")  #查看剩余缓存
t.add(cn("\nZ盘总大小:") + unicode(sysinfo.total_rom() / 1024) + u"kb")  #查看Z盘总大小

e32.Ao_lock().wait()
Example #5
0
def pasek():
    global screen
    global img
    global ekran
    global mp3
    global ladow
    while 1:
        e32.Ao_timer().after(1)
        (rok, mies, dz, godz, min, sek, x, x, x) = time.localtime()
        godz = '%02d' % (godz)
        min = '%02d' % (min)
        sek = '%02d' % (sek)
        if (godz == ustaw[51:53]) and (min == ustaw[53:55]) and (
                sek == '00') and (pb <> 'None'):
            e32.reset_inactivity()
            try:
                appuifw.e32.start_exe(
                    u'c:\\sys\\bin\\' + unicode(pb) + u'.exe', '')
            except:
                try:
                    appuifw.e32.start_exe(
                        u'e:\\sys\\bin\\' + unicode(pb) + u'.exe', '')
                except:
                    try:
                        appuifw.e32.start_exe(
                            u'z:\\sys\\bin\\' + unicode(pb) + u'.exe', '')
                    except:
                        pass
        try:
            if (int(ustaw[36:39]) <> 0) and (sysinfo.active_profile() <>
                                             u'silent'):
                if ((int(min) == 0) and (int(sek) == 0)
                        or (int(sysinfo.battery()) == 100) and (ladow > 0)):
                    if (int(sysinfo.battery()) == 100) and (ladow > 0):
                        ladow = 0
                    if os.path.isdir(sciezkaplik):
                        if (int(min) == 0) and (int(sek) == 0):
                            mp3 = audio.Sound.open(
                                unicode(sciezkaplik + '\\' + str(godz) +
                                        '.mp3'))
                        else:
                            mp3 = audio.Sound.open(
                                unicode(sciezkaplik + '\\' + '24.mp3'))
                    else:
                        mp3 = audio.Sound.open(unicode(sciezkaplik))
                    if (int(ustaw[39:42]) < int(ustaw[42:45])) and (
                            int(godz) >= int(ustaw[39:42])) and (
                                int(godz) <= int(ustaw[42:45])):
                        mp3.play()
                    elif (int(ustaw[39:42]) > int(ustaw[42:45])) and (
                        (int(godz) >= int(ustaw[39:42])) or
                        (int(godz) <= int(ustaw[42:45]))):
                        mp3.play()
                    elif int(godz) == int(ustaw[39:42]):
                        mp3.play()
                    audio.Sound.set_volume(
                        mp3,
                        int(
                            audio.Sound.max_volume(mp3) *
                            (float(int(ustaw[36:39])) / float(100))))
            if audio.Sound.state(mp3) <> 2: mp3 = 0
            if (int(min) == 0) and (int(sek) == 0):
                if (int(ustaw[39:42]) < int(ustaw[42:45])) and (
                        int(godz) >= int(ustaw[39:42])) and (int(godz) <= int(
                            ustaw[42:45])):
                    miso.vibrate(500, 100)
                elif (int(ustaw[39:42]) > int(ustaw[42:45])) and (
                    (int(godz) >= int(ustaw[39:42])) or
                    (int(godz) <= int(ustaw[42:45]))):
                    miso.vibrate(500, 100)
                elif int(godz) == int(ustaw[39:42]):
                    miso.vibrate(500, 100)
        except:
            pass
        if int(ustaw[18:21]) == 888:
            img.blit(ima, ((0, 0), (int(ustaw[0:3]), int(ustaw[3:6]))))
        else:
            img.rectangle(
                [(0, 0), (int(ustaw[0:3]), int(ustaw[3:6]))],
                (int(ustaw[18:21]), int(ustaw[21:24]), int(ustaw[24:27])),
                fill=(int(ustaw[18:21]), int(ustaw[21:24]), int(ustaw[24:27])))
        if pb <> 'None':
            img.line([(0, 0), (0, int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(-1 + int(ustaw[0:3]), 0),
                      (-1 + int(ustaw[0:3]), int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
        if fpp[int(ustaw[56:57])] <> 'None':
            img.line([(0, 0), (0, 4)],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(0, 0), (4, 0)],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(-1 + int(ustaw[0:3]), 0), (-1 + int(ustaw[0:3]), 4)],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(-1 + int(ustaw[0:3]), 0),
                      (-1 - 4 + int(ustaw[0:3]), 0)],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(-1 + int(ustaw[0:3]), -1 + int(ustaw[3:6])),
                      (-1 - 4 + int(ustaw[0:3]), -1 + int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(-1 + int(ustaw[0:3]), -1 + int(ustaw[3:6])),
                      (-1 + int(ustaw[0:3]), -1 - 4 + int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(0, -1 + int(ustaw[3:6])),
                      (0, -1 - 4 + int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            img.line([(0, -1 + int(ustaw[3:6])), (4, -1 + int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
        if ekran > 0:
            e32.reset_inactivity()
            img.line([(0, -1 + int(ustaw[3:6])),
                      (int(ustaw[0:3]), -1 + int(ustaw[3:6]))],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
        if ladow > 0:
            img.line([(0, 0), (int(ustaw[0:3]), 0)],
                     (int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
        if int(ustaw[45:48]) / 10 > 0:
            if int(ustaw[45:48]) / 10 == 1:
                k = unicode(str(godz) + ':' + str(min) + ':' + str(sek))
            elif int(ustaw[45:48]) / 10 == 2:
                k = unicode('%02i' % (dz) + '.' + '%02i' % (mies) + '.' +
                            str(rok))
            elif int(ustaw[45:48]) / 10 == 3:
                k = unicode('%06.3f' %
                            (float(sysinfo.free_ram()) / float(1000000)))
            elif int(ustaw[45:48]) / 10 == 4:
                k = unicode('%03i' % (sysinfo.signal_dbm()) + ' dBm')
            elif int(ustaw[45:48]) / 10 == 5:
                k = unicode('%03i' % (sysinfo.battery()) + ' %')
            if int(ustaw[45:48]) % 10 == 1:
                q = (None, None, graphics.FONT_BOLD | graphics.FONT_ANTIALIAS)
            elif int(ustaw[45:48]) % 10 == 2:
                q = (None, None,
                     graphics.FONT_ITALIC | graphics.FONT_ANTIALIAS)
            elif int(ustaw[45:48]) % 10 == 3:
                q = (None, None, graphics.FONT_BOLD | graphics.FONT_ITALIC
                     | graphics.FONT_ANTIALIAS)
            else:
                q = (None, None, graphics.FONT_ANTIALIAS)
            img.text(
                (int(ustaw[12:15]), int(ustaw[15:18])),
                k,
                font=q,
                fill=(int(ustaw[27:30]), int(ustaw[30:33]), int(ustaw[33:36])))
            screen.background_color = 0xffffff
        else:
            screen.hide()
Example #6
0
        w.close()
        del w
    else:
        return None

def speak_word():
    w=dialog.Wait(u'Speaking...')
    w.show()
    audio.say(t.get(t.get_word_info(t.get_pos())[0],t.get_word_info(t.get_pos())[1]))
    w.close()
    del w

if sysinfo.battery()<=10:
    if globalui.global_query(u'Battery is low\nSpeak drains battery fast, Continue?')==0:
        os.abort()
pro=sysinfo.active_profile()
if pro=='offline' or pro=='silent':
    if globalui.global_query(u'Phone in '+pro+' profile, Continue?')==0:
        os.abort()

def load(percent=6.25):
    can.clear((255,255,255))
    can.rectangle([(0),(0),(di[0]*percent/100),(di[1])],outline=(200,200,200),fill=(100,100,100),width=3)
    can.text((di[0]/2-15,di[1]/2+10),str(int(percent)).decode('u8')+u'%',(13,49,102),'title')
    e32.ao_sleep(0.0000000001)

load(6.25)
import audio
load(12.5)
import os
load(18.75)
Example #7
0
 def test_active_profile(self):
     self._test_util("active_profile", sysinfo.active_profile())
Example #8
0
import e32

sys.stdout.write("IMEI: %s\n" % sysinfo.imei())

sys.stdout.write("Battery strength: %s\n" % sysinfo.battery())
 
sys.stdout.write("Signal strength: %s\n" % sysinfo.signal_bars())
 
sys.stdout.write("Network signal strength in dBm: %s\n" % sysinfo.signal_dbm())
 
sys.stdout.write("SW version: %s\n" % sysinfo.sw_version())
 
sys.stdout.write("Display size:\n")
print(sysinfo.display_pixels())
 
sys.stdout.write("Current profile: %s\n" % sysinfo.active_profile())
 
sys.stdout.write("Ringing type: %s\n" % sysinfo.ring_type())
 
sys.stdout.write("OS version:\n")
print(sysinfo.os_version())

sys.stdout.write("Free/total RAM (MB): %.2f / %.2f\n" % (sysinfo.free_ram()/1024/1024,sysinfo.total_ram()/1024/1024))
 
sys.stdout.write("Total ROM (MB): %.2f \n" % (sysinfo.total_rom()/1024/1024))
 
sys.stdout.write("Free disk space C/E (MB): %.2f / %.2f\n" % (sysinfo.free_drivespace()['C:']/1024/1024,sysinfo.free_drivespace()['E:']/1024/1024))

sys.stdout.write("Python version: %s (%s, %s)\n" % (e32.pys60_version,e32.pys60_version_info[0],e32.pys60_version_info[1]))
 
sys.stdout.write("Symbian version: (%s, %s)\n" % (e32.s60_version_info[0],e32.s60_version_info[1]))