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)
Exemple #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.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_green'] = Button('')
     self['key_red'] = Button(_('Ok'))
     self['key_blue'] = Button(_('Exit'))
     self['key_yellow'] = Button('')
     self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'blue': self.quit,
      'red': self.ok,
      'ok': self.ok,
      'cancel': self.quit}, -2)
     self.onShown.append(self.setWindowTitle)
Exemple #3
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)
Exemple #4
0
 def initialaze(self, result):
     if result != 5:
         self.result = 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)
Exemple #5
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')
 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')
         Console().ePopen('mkdir /hdd/movie')
         Console().ePopen('mkdir /hdd/music')
         Console().ePopen('mkdir /hdd/picture')
Exemple #7
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)
    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] / 1048576)
            mp = self.mountpoints.get(self.disk[0], count)
            if len(mp) > 0:
                self.partitions.append(
                    PartitionEntry(
                        'Partition %d - %s (%s)' % (count, part[2], mp),
                        capacity))
            else:
                self.partitions.append(
                    PartitionEntry('Partition %d - %s' % (count, part[2]),
                                   capacity))
            count += 1

        if uirefresh:
            self['menu'].setList(self.partitions)
Exemple #9
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)