def extract_one(s):
     if not user.query(u"Estrarre il file %s nella cartella %s" %
                       (to_unicode(os.path.basename(
                           s.get_file()))[:-4], to_unicode(s.extractdir)),
                       s.plugin_name,
                       left=u"Estrai"):
         return
     import sysinfo
     #molto approssimativa
     if os.path.getsize(s.filename) / aiff.total(
     ) > sysinfo.free_drivespace()[s.filename[0:2].capitalize()]:
         user.note(
             u"Spazio su disco insufficiente per continuare!\nEliminare qualche dato e riprovare",
             s.plugin_name)
         return
     d = progress_dialog(u"Estrazione immagine in corso...",
                         u"Creazione cartella",
                         max=1)
     d.draw()
     d.forward()
     if s.comp_type:
         d.set_title(
             to_unicode(os.path.basename(s.get_file()))[:-4] + ".png")
     else:
         d.set_title(
             to_unicode(os.path.basename(s.get_file()))[:-4] + ".jpg")
     d.draw()
     s.extract_file(ListBox.current() + 1)
     d.close()
     user.note(
         u"Estrazione del file %s completata!" %
         (to_unicode(os.path.basename(s.get_file()))[:-4]), s.plugin_name)
 def extract(s):
     if not user.query(
             u"Estrarre il contenuto del file AIF nella cartella %s" %
         (to_unicode(s.extractdir)),
             s.plugin_name,
             left=u"Estrai"):
         return
     import sysinfo
     if os.path.getsize(s.filename) > sysinfo.free_drivespace()[
             s.filename[0:2].capitalize()]:
         user.note(
             u"Spazio su disco insufficiente per continuare!\nEliminare qualche dato e riprovare",
             s.plugin_name)
         return
     bakland = ui.landscape
     s.gira_schermo(0)
     d = progress_dialog(u"Estrazione immagini in corso...",
                         u"Creazione cartella",
                         max=aiff.total())
     i = 1
     d.draw()
     while i < aiff.total() + 1:
         d.forward()
         if s.comp_type:
             d.set_title(to_unicode(s.file_name(i)[:-4] + ".png"))
         else:
             d.set_title(to_unicode(s.file_name(i)[:-4] + ".jpg"))
         d.draw()
         s.extract_file(i)
         i += 1
     d.close()
     s.gira_schermo(bakland)
     user.note(u"Estrazione completata!", s.plugin_name)
Exemple #3
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)
Exemple #4
0
def show_free_space():
    #Free space (duration ~5 secs)

    free = sysinfo.free_drivespace()
    unit_v = directory.split(u':')
    unit = unit_v[0]
    unit = unit + u':'
    mem_free = free[u'E:']
    mem_free = mem_free / 1024
    texto.add(u'Free space : ' + str(mem_free) + u' kb\n')
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())
Exemple #6
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() == "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 __info(self):
     ind=self.lb.current()
     obj=self.all[ind][0]
     info=os.stat(obj)
     seq=time.localtime(info.st_mtime)
     a=[(u'FullName', obj), (u'Last Modified', time.strftime('%d-%m-%Y at %H:%M:%S', seq))]
     if os.path.isfile(obj):
         size=info.st_size
         if size>1024*1024*1024:
             size='%0.2f GB (%d bytes)' %(size/1024/1024/1024., size)
         elif size>1024*1024:
             size='%0.2f MB (%d bytes)' %(size/1024/1024., size)
         elif size>1024:
             size='%0.2f KB (%d bytes)' %(size/1024., size)
         else:
             size=str(size)+' Byte(s)'
         a.append((u'Size', size))
     if obj.endswith(u':'):
         size=sysinfo.free_drivespace()[obj]
         if size>1024*1024*1024:
             size='%0.2f GB (%d bytes)' %(size/1024/1024/1024., size)
         elif size>1024*1024:
             size='%0.2f MB (%d bytes)' %(size/1024/1024., size)
         elif size>1024:
             size='%0.2f KB (%d bytes)' %(size/1024., size)
         else:
             size=str(size)+' Byte(s)'
         a.append((u'FreeSpace', size))
     mod=info[0]
     if mod&128:
         mode=u'Read and Write'
     else:
         mode=u'Read Only'
     a.append((u'Access Mode', mode))
     note="\n".join(["%s: %s" % (k, v) for k, v in a])
     if obj.endswith(':'):
         base=obj+u' Drive'
     else:
         base=os.path.basename(obj)
     return infopopup(note, base, OKREmpty)
Exemple #9
0
 def test_free_drivespace(self):
     sysinfo.free_drivespace()
Exemple #10
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()

Exemple #11
0
#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()
# 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()
Exemple #13
0
 
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")
print(e32.get_capabilities())

sys.stdout.write("Check WriteUserData: %s\n" % e32.has_capabilities(['WriteUserData']))