self.onLayoutFinish.append(self.timerStart)
self.formatStartTimer = eTimer()
self.formatStartTimer.callback.append(self.DeviceFormatStart)
+ self.setHotplugDisabled = False
def timerStart(self):
self.formatStartTimer.start(100,True)
def DeviceFormatStart(self):
+ devicemanagerhotplug.setHotplugActive(False)
+ self.setHotplugDisabled = True
print "DeviceFormatStart : ", self.partition,
print "Filesystem : ",self.newfstype
device = self.partition["partition"]
self.session.openWithCallback(self.exit, MessageBox, msg, MessageBox.TYPE_ERROR, timeout = 10)
def exit(self, ret):
+ if self.setHotplugDisabled == True:
+ devicemanagerhotplug.setHotplugActive(True)
+ self.setHotplugDisabled = False
self.close()
#device format end
def __init__(self):
self.hotplugActive = True
+ def setHotplugActive(self,value=True):
+ if value:
+ self.hotplugActive = True
+ else:
+ self.hotplugActive = False
+
def printDebug(self):
for p in harddiskmanager.partitions:
print " # partition : %s %s %s %s %s(mp, des, f_mounted, is_hot, dev)"%(p.mountpoint, p.description, p.force_mounted, p.is_hotplug,p.device)
def doUmount(self, device, mountpoint):
devpath = "/dev/"+device
- if len(deviceinfo.checkMountDev(devpath)) == 0:
+ mountpoints = deviceinfo.checkMountDev(devpath)
+ if len(mountpoints) == 0:
return
- cmd = "umount %s"%devpath
- print "[DeviceManager] cmd : %s"%cmd
- os.system(cmd)
+ for mp in mountpoints:
+ cmd = "umount %s"%devpath
+ print "[DeviceManager] cmd : %s"%cmd
+ os.system(cmd)
def addHotPlugDevice(self, partition):
device = partition.device