Skip to content

Commit

Permalink
Plugins/Extensions/MediaScanner py3
Browse files Browse the repository at this point in the history
  • Loading branch information
tony whalley authored and Huevos committed Apr 12, 2021
1 parent ed4ec68 commit 5d7b9f4
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/python/Plugins/Extensions/MediaScanner/plugin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from Plugins.Plugin import PluginDescriptor
from __future__ import print_function

import os

from Components.Scanner import scanDevice
from Plugins.Plugin import PluginDescriptor
from Screens.InfoBar import InfoBar
import os


def execute(option):
print "execute", option
print("execute", option)
if option is None:
return

Expand All @@ -17,7 +21,7 @@ def mountpoint_choosen(option):

from Screens.ChoiceBox import ChoiceBox

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

Expand All @@ -28,7 +32,7 @@ def mountpoint_choosen(option):
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"
print("ignore", mountpoint, "because its not accessible")
return

session.openWithCallback(execute, ChoiceBox,
Expand Down Expand Up @@ -61,14 +65,14 @@ def partitionListChanged(action, device):
if InfoBar.instance:
if InfoBar.instance.execing:
if action == 'add' and device.is_hotplug:
print "mountpoint", device.mountpoint
print "description", device.description
print "force_mounted", device.force_mounted
print("mountpoint", device.mountpoint)
print("description", device.description)
print("force_mounted", device.force_mounted)
mountpoint_choosen((device.description, device.mountpoint, global_session))
else:
print "main infobar is not execing... so we ignore hotplug event!"
print("main infobar is not execing... so we ignore hotplug event!")
else:
print "hotplug event.. but no infobar"
print("hotplug event.. but no infobar")

def sessionstart(reason, session):
global global_session
Expand Down

0 comments on commit 5d7b9f4

Please sign in to comment.