projects
/
vuplus_dvbapp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
do not show inaccessible devices in deviceselection
[vuplus_dvbapp]
/
lib
/
python
/
Plugins
/
Extensions
/
MediaScanner
/
plugin.py
diff --git
a/lib/python/Plugins/Extensions/MediaScanner/plugin.py
b/lib/python/Plugins/Extensions/MediaScanner/plugin.py
old mode 100644
(file)
new mode 100755
(executable)
index
5b320ea
..
2c31197
--- a/
lib/python/Plugins/Extensions/MediaScanner/plugin.py
+++ b/
lib/python/Plugins/Extensions/MediaScanner/plugin.py
@@
-1,6
+1,7
@@
from Plugins.Plugin import PluginDescriptor
from Components.Scanner import scanDevice
from Screens.InfoBar import InfoBar
from Plugins.Plugin import PluginDescriptor
from Components.Scanner import scanDevice
from Screens.InfoBar import InfoBar
+from os import access, F_OK, R_OK
def execute(option):
print "execute", option
def execute(option):
print "execute", option
@@
-16,15
+17,18
@@
def mountpoint_choosen(option):
from Screens.ChoiceBox import ChoiceBox
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 list == [ ]:
(description, mountpoint, session) = option
res = scanDevice(mountpoint)
list = [ (r.description, r, res[r], session) for r in res ]
if list == [ ]:
- print "nothing found"
from Screens.MessageBox import MessageBox
from Screens.MessageBox import MessageBox
- session.open(MessageBox, "No displayable files on this medium found!", MessageBox.TYPE_ERROR)
+ 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,
return
session.openWithCallback(execute, ChoiceBox,
@@
-38,6
+42,9
@@
def scan(session):
parts = [ (r.description, r.mountpoint, session) for r in harddiskmanager.getMountedPartitions(onlyhotplug = False)]
if len(parts):
parts = [ (r.description, r.mountpoint, session) for r in harddiskmanager.getMountedPartitions(onlyhotplug = False)]
if len(parts):
+ for x in parts:
+ if not access(x[1], F_OK|R_OK):
+ parts.remove(x)
session.openWithCallback(mountpoint_choosen, ChoiceBox, title = _("Please Select Medium to be Scanned"), list = parts)
def main(session, **kwargs):
session.openWithCallback(mountpoint_choosen, ChoiceBox, title = _("Please Select Medium to be Scanned"), list = parts)
def main(session, **kwargs):