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)
def show_ram_usage(self): x1 = 0 y1 = 0 x2 = x1 + 130 y2 = y1 + 15 x3 = x1 + 1 y3 = y1 + 12 conv = 1024.0 txt = u"RAM: %.2f / %.2f MB" % ((free_ram() / conv / conv), (total_ram() / conv / conv)) self.buffer.rectangle((x1, y1, x2, y2), fill=WHITE) self.buffer.text((x3, y3), txt, fill=BLACK)
def Info(): #print 'Device Time: ' + sysinfo.active_profile() print 'Active Profile: '.ljust(24) + sysinfo.active_profile() print 'Software Version: '.ljust(24) + str(sysinfo.sw_version()) print 'OS Version: '.ljust(24) + str(sysinfo.os_version()) print 'Battery: '.ljust(24) + str(sysinfo.battery()) + '%' print 'Display Resolution: '.ljust(24) + str( sysinfo.display_pixels()[0]) + 'x' + str(sysinfo.display_pixels()[1]) print 'IMEI: '.ljust(24) + sysinfo.imei() #print 'RAM Drive Size: ' + str(sysinfo.max_ramdrive_size()) print 'RAM Size(total/free): '.ljust(24) + str(sysinfo.total_ram()) + str( sysinfo.free_ram()) print 'ROM Size: '.ljust(24) + str(sysinfo.total_rom()) print 'Free Drive Space: '.ljust(24) + str(sysinfo.free_drivespace()) print 'Signal Strength:'.ljust(24) + str(sysinfo.signal_bars())
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() == "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().items(): 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)
def mem(): r = sysinfo.total_ram() r1 = str(r) r2 = int(r1) r3 = (r2 / 1024000) ro = sysinfo.total_rom() ro1 = str(ro) ro2 = int(ro1) ro3 = (ro2 / 1024000) fr = sysinfo.free_ram() f = str(fr) fre = int(f) fo = (fre / 1024) dr = sysinfo.free_drivespace() osama.add(((itq('\n\t...................\nTotal ram is :\n') + str(r3)) + itq(' MB'))) osama.add(((itq('\nThe Free ram is :\n') + str(fo)) + itq(' KB'))) osama.add(((itq('\nTotal ROM size is :\n') + str(ro3)) + itq(' MB'))) osama.add( ((itq('\n_______\n\nDRIVES Disk space in byte is :\n') + str(dr)) + itq(' Byte\n\t...................\n')))
def app(): appuifw.app.exit_key_handler = lock.signal active_profile = sysinfo.active_profile() battery = sysinfo.battery() d1, d2 = sysinfo.display_pixels() free_ram = sysinfo.free_ram() / float(1024 * 1024) total_ram = sysinfo.total_ram() / float(1024 * 1024) imei = sysinfo.imei() sw_version_list = sysinfo.sw_version().split(' ') data_list = [(ru("Active Profile:"), ru(active_profile)), (ru("Battery Percentage:"), ru(battery)), (ru("Free RAM:"), ru(str(free_ram)[:6] + " MB/" + str(total_ram)[:6] + " MB")), (ru("Display:"), ru(str(d1) + " x " + str(d2))), (ru("IMEI:"), imei), (u"Software Version:", sw_version_list[0]), (u"Software Version Date:", sw_version_list[1]), (u"Type", sw_version_list[2])] list = appuifw.Listbox(data_list, lambda: None) appuifw.app.body = list appuifw.app.menu = [(u"Refresh Info", app), (u"About", about)]
def test_free_ram(self): sysinfo.free_ram()
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()
#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()
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()
# including without limitation the rights to use, copy, modify, merge, # publish, distribute, sublicense, and/or sell copies of the Software, # and to permit persons to whom the Software is furnished to do so, # subject to the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from miso import * print str(num_alloc_heap_cells()) print str(num_free_heap_cells()) print str(alloc_heap_cells_size()) print str(heap_biggest_avail()) print str(heap_total_avail()) from sysinfo import total_ram, free_ram print "sysinfo:" print str(total_ram()) print str(free_ram())
# limitations under the License. import sysinfo print "OS: " print sysinfo.os_version() print "SW: " print sysinfo.sw_version() print "IMEI: " print sysinfo.imei() print "Bat: " print sysinfo.battery() print "Net: " print sysinfo.signal() print "Ram: " print sysinfo.total_ram() print "Rom: " print sysinfo.total_rom() print "MaxRamDrive: " print sysinfo.max_ramdrive_size() print "Twips: " print sysinfo.display_twips() print "Pixels: " print sysinfo.display_pixels() print "RamFree: " print sysinfo.free_ram() print "DriveSpace: " print sysinfo.free_drivespace() print "RingType: " print sysinfo.ring_type()
def devInfo(self): all=[(u'IMEI', sysinfo.imei()), (u'Total RAM', str(sysinfo.total_ram()/1024)+'KByte(s)'), (u'Free RAM', str(sysinfo.free_ram()/1024)+'KByte(s)'), (u'Battery', str(sysinfo.battery()*100/7)+u'%')] info='\n'.join(['%s: %s' %(k, v) for k, v in all]) e32.ao_yield() return infopopup(info, u'Phone Info', OKREmpty)
def compress(self): old=sysinfo.free_ram() miso.compress_all_heaps() new=sysinfo.free_ram() dif=(new-old)/1024 return ui.note(str(dif)+u' kbyte(s) released')
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])) sys.stdout.write("Available drives: \n") print(e32.drive_list()) sys.stdout.write("Inactivity time: %s\n" % e32.inactivity()) sys.stdout.write("Platf. sec. capabilities: \n")