Example #1
0
def mountpoint_choosen(option):
	if option is None:
		return

	from Screens.ChoiceBox import ChoiceBox

	print "scanning", option
	(description, mountpoint, session) = option
	res = scanDevice(mountpoint)

	list = [ (r.description, r, res[r], session) for r in res ]

	if not list:
		if mountpoint != "/":
			from Components.Harddisk import harddiskmanager
			p = harddiskmanager.getPartitionbyMountpoint(mountpoint)
			if p is not None and p.uuid is None: #ignore partitions with unknown or no filesystem uuid
				print "ignore", mountpoint, "because we have no uuid"
				return

		from Screens.MessageBox import MessageBox
		if access(mountpoint, F_OK|R_OK):
			session.open(MessageBox, _("No displayable files on this medium found!"), MessageBox.TYPE_ERROR)
		else:
			print "ignore", mountpoint, "because its not accessible"
		return
	
	session.openWithCallback(execute, ChoiceBox, 
		title = _("The following files were found..."),
		list = list)
Example #2
0
def mountpoint_choosen(option):
    if option is None:
        return

    from Screens.ChoiceBox import ChoiceBox

    print "scanning", option
    (description, mountpoint, session) = option
    res = scanDevice(mountpoint)

    list = [(r.description, r, res[r], session) for r in res]

    if not list:
        from Screens.MessageBox import MessageBox
        if os.access(mountpoint, os.F_OK | os.R_OK):
            session.open(MessageBox,
                         _("No displayable files on this medium found!"),
                         MessageBox.TYPE_ERROR)
        else:
            print "ignore", mountpoint, "because its not accessible"
        return

    session.openWithCallback(execute,
                             ChoiceBox,
                             title=_("The following files were found..."),
                             list=list)
Example #3
0
	def scanHotplug(self):
		devicepath = harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())
		if pathExists(devicepath):
			from Components.Scanner import scanDevice
			res = scanDevice(devicepath)
			list = [ (r.description, r, res[r], self.session) for r in res ]
			if list:
				(desc, scanner, files, session) = list[0]
				for file in files:
					if file.mimetype == "video/x-dvd":
						print "[DVD] physical dvd found:", devicepath
						self.physicalDVD = True
						return
		self.physicalDVD = False
Example #4
0
	def scanHotplug(self):
		devicepath = harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())
		if pathExists(devicepath):
			from Components.Scanner import scanDevice
			res = scanDevice(devicepath)
			list = [ (r.description, r, res[r], self.session) for r in res ]
			if list:
				(desc, scanner, files, session) = list[0]
				for file in files:
					if file.mimetype == "video/x-dvd":
						print "[DVD] physical dvd found:", devicepath
						self.physicalDVD = True
						return
		self.physicalDVD = False
Example #5
0
def mountpoint_chosen(option):
    if option is None:
        return

    from Screens.ChoiceBox import ChoiceBox

    print "scanning", option
    (description, mountpoint, session) = option
    res = scanDevice(mountpoint)

    list = [(r.description, r, res[r], session) for r in res]

    if not list:
        from Components.Harddisk import harddiskmanager
        from Components.UsageConfig import defaultStorageDevice
        p = harddiskmanager.getPartitionbyMountpoint(mountpoint)

        if mountpoint != "/":
            if p is not None and p.uuid is None:  #ignore partitions with unknown or no filesystem uuid
                print "ignore", mountpoint, "because we have no uuid"
                return
            if defaultStorageDevice(
            ) == "<undefined>" or not harddiskmanager.HDDEnabledCount(
            ):  # no configured default storage device found
                if p is not None and p.isInitialized:
                    print "ignore", mountpoint, "as its usable as default storage device"
                    return

        description = None
        if p:
            description = p.description

        from Screens.MessageBox import MessageBox
        if access(mountpoint, F_OK | R_OK):
            session.open(MessageBox,
                         _("No displayable files on this medium found!"),
                         MessageBox.TYPE_ERROR,
                         timeout=10,
                         title=description)
        else:
            print "ignore", mountpoint, "because its not accessible"
        return

    session.openWithCallback(execute,
                             ChoiceBox,
                             title=_("The following files were found..."),
                             list=list)
Example #6
0
	def hotplugCB(self, dev, media_state):
		if dev == harddiskmanager.getCD():
			if media_state == "1":
				from Components.Scanner import scanDevice
				devpath = harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())
				self.cdAudioTrackFiles = []
				res = scanDevice(devpath)
				list = [(r.description, r, res[r], self.session) for r in res]
				if list:
					(desc, scanner, files, session) = list[0]
					for file in files:
						if file.mimetype == "audio/x-cda":
							self.cdAudioTrackFiles.append(file.path)
			else:
				self.cdAudioTrackFiles = []
				if self.isAudioCD:
					self.clear_playlist()
Example #7
0
	def hotplugCB(self, dev, media_state):
		if dev == harddiskmanager.getCD():
			if media_state == "1":
				from Components.Scanner import scanDevice
				devpath = harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())
				self.cdAudioTrackFiles = []
				res = scanDevice(devpath)
				list = [ (r.description, r, res[r], self.session) for r in res ]
				if list:
					(desc, scanner, files, session) = list[0]
					for file in files:
						if file.mimetype == "audio/x-cda":
							self.cdAudioTrackFiles.append(file.path)
			else:
				self.cdAudioTrackFiles = []
				if self.isAudioCD:
					self.clear_playlist()
Example #8
0
def mountpoint_chosen(option):
	if option is None:
		return

	from Screens.ChoiceBox import ChoiceBox

	print "scanning", option
	(description, mountpoint, session) = option
	res = scanDevice(mountpoint)

	list = [ (r.description, r, res[r], session) for r in res ]

	if not list:
		from Components.Harddisk import harddiskmanager
		from Components.UsageConfig import defaultStorageDevice
		p = harddiskmanager.getPartitionbyMountpoint(mountpoint)

		if mountpoint != "/":
			if p is not None and p.uuid is None: #ignore partitions with unknown or no filesystem uuid
				print "ignore", mountpoint, "because we have no uuid"
				return
			if defaultStorageDevice() == "<undefined>" or not harddiskmanager.HDDEnabledCount(): # no configured default storage device found
				if p is not None and p.isInitialized:
					print "ignore", mountpoint, "as its usable as default storage device"
					return

		description = None
		if p:
			description = p.description

		from Screens.MessageBox import MessageBox
		if access(mountpoint, F_OK|R_OK):
			session.open(MessageBox, _("No displayable files on this medium found!"), MessageBox.TYPE_ERROR, timeout = 10, title = description)
		else:
			print "ignore", mountpoint, "because its not accessible"
		return
	
	session.openWithCallback(execute, ChoiceBox, 
		title = _("The following files were found..."),
		list = list)
Example #9
0
def mountpoint_choosen(option):
	if option is None:
		return

	from Screens.ChoiceBox import ChoiceBox

	print "scanning", option
	(description, mountpoint, session) = option
	res = scanDevice(mountpoint)

	list = [ (r.description, r, res[r], session) for r in res ]

	if not list:
		from Screens.MessageBox import MessageBox
		if os.access(mountpoint, os.F_OK|os.R_OK):
			session.open(MessageBox, _("No displayable files on this medium found!"), MessageBox.TYPE_INFO, simple = True, timeout = 5)
		else:
			print "ignore", mountpoint, "because its not accessible"
		return

	session.openWithCallback(execute, ChoiceBox,
		title = _("The following files were found..."),
		list = list)