Exemplo n.º 1
0
    def refreshMP(self, uirefresh=True):
        self.partitions = []
        self.mountpoints = MountPoints()
        self.mountpoints.read()
        count = 1
        for part in self.disk[5]:
            capacity = "%d MB" % (part[1] / (1024 * 1024))
            mp = self.mountpoints.get(self.disk[0], count)
            rmp = self.mountpoints.getRealMount(self.disk[0], count)
            if len(mp) > 0:
                self.partitions.append(
                    PartitionEntry(
                        "P. %d - %s (Fixed: %s)" % (count, part[2], mp),
                        capacity))
            elif len(rmp) > 0:
                self.partitions.append(
                    PartitionEntry(
                        "P. %d - %s (Fast: %s)" % (count, part[2], rmp),
                        capacity))
            else:
                self.partitions.append(
                    PartitionEntry("P. %d - %s" % (count, part[2]), capacity))
            count += 1

        if uirefresh:
            self["menu"].setList(self.partitions)
Exemplo n.º 2
0
    def __init__(self, session, device, partition):
        Screen.__init__(self, session)

        self.device = device
        self.partition = partition
        self.mountpoints = MountPoints()
        self.mountpoints.read()
        self.fast = False

        self.list = []
        self.list.append("Mount as main hdd")
        self.list.append("Mount as /media/usb")
        self.list.append("Mount as /media/usb1")
        self.list.append("Mount as /media/usb2")
        self.list.append("Mount as /media/usb3")
        self.list.append("Mount as /media/cf")
        self.list.append("Mount as /media/mmc1")
        self.list.append("Mount on custom path")

        self["menu"] = MenuList(self.list)

        self["key_red"] = Button(_("Fixed mount"))
        self["key_green"] = Button("Fast mount")
        self["key_blue"] = Button(_("Exit"))
        #self["key_yellow"] = Button("")
        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "blue": self.quit,
                "green": self.green,
                "ok": self.ok,
                "red": self.ok,
                "cancel": self.quit,
            }, -2)
Exemplo n.º 3
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.mdisks = Disks()
     self.mountpoints = MountPoints()
     self.mountpoints.read()
     self.disks = list()
     self.mounts = list()
     for disk in self.mdisks.disks:
         if disk[2] == True:
             diskname = disk[3]
             for partition in disk[5]:
                 mp = ""
                 rmp = ""
                 try:
                     mp = self.mountpoints.get(partition[0][:3],
                                               int(partition[0][3:]))
                     rmp = self.mountpoints.getRealMount(
                         partition[0][:3], int(partition[0][3:]))
                 except Exception, e:
                     pass
                 if len(mp) > 0:
                     self.disks.append(
                         MountEntry(
                             disk[3],
                             "P.%s (Fixed: %s)" % (partition[0][3:], mp)))
                     self.mounts.append(mp)
                 elif len(rmp) > 0:
                     self.disks.append(
                         MountEntry(
                             disk[3],
                             "P.%s (Fast: %s)" % (partition[0][3:], rmp)))
                     self.mounts.append(rmp)
Exemplo n.º 4
0
 def checkDefault(self):
     mp = MountPoints()
     mp.read()
     if not mp.exist("/hdd"):
         mp.add(self.mdisks.disks[self.sindex][0], 1, "/hdd")
         mp.write()
         mp.mount(self.mdisks.disks[self.sindex][0], 1, "/hdd")
         os.system("/bin/mkdir /hdd/movie")
         os.system("/bin/mkdir /hdd/music")
         os.system("/bin/mkdir /hdd/picture")
Exemplo n.º 5
0
	def initialaze(self, result):
		if not self.isExt4Supported():
			result += 1
			
		if result != 4:
			self.fsresult = result
			self.formatted = 0
			mp = MountPoints()
			mp.read()
			mp.deleteDisk(self.mdisks.disks[self.sindex][0])
			mp.write()
			self.session.openWithCallback(self.fdiskEnded, ExtraActionBox, "Partitioning...", "Initialize disk", self.fdisk)
Exemplo n.º 6
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.mdisks = Disks()
        self.mountpoints = MountPoints()
        self.mountpoints.read()
        self.disks = list()
        self.mounts = list()
        for disk in self.mdisks.disks:
            if disk[2] == True:
                diskname = disk[3]
                for partition in disk[5]:
                    mp = ""
                    rmp = ""
                    try:
                        if "mmcblk1" in partition[0][:7]:
                            mp = self.mountpoints.get(partition[0][:7],
                                                      int(partition[0][8:]))
                            rmp = self.mountpoints.getRealMount(
                                partition[0][:7], int(partition[0][8:]))
                        else:
                            mp = self.mountpoints.get(partition[0][:3],
                                                      int(partition[0][3:]))
                            rmp = self.mountpoints.getRealMount(
                                partition[0][:3], int(partition[0][3:]))
                    except Exception as e:
                        pass
                    if len(mp) > 0:
                        if "mmcblk1" in partition[0][:7]:
                            self.disks.append(
                                MountEntry(
                                    disk[3], "P.%s (Fixed: %s)" %
                                    (partition[0][7:], mp)))
                            self.mounts.append(mp)
                        else:
                            self.disks.append(
                                MountEntry(
                                    disk[3], "P.%s (Fixed: %s)" %
                                    (partition[0][3:], mp)))
                            self.mounts.append(mp)
                    elif len(rmp) > 0:
                        if "mmcblk1" in partition[0][:7]:
                            self.disks.append(
                                MountEntry(
                                    disk[3], "P.%s (Fast: %s)" %
                                    (partition[0][7:], rmp)))
                            self.mounts.append(rmp)
                        else:
                            self.disks.append(
                                MountEntry(
                                    disk[3], "P.%s (Fast: %s)" %
                                    (partition[0][3:], rmp)))
                            self.mounts.append(rmp)

        self["menu"] = List(self.disks)
        self["key_red"] = Button(_("Umount"))
        self["key_blue"] = Button(_("Exit"))
        self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {
            "blue": self.quit,
            "red": self.red,
            "cancel": self.quit,
        }, -2)