From f3a9c38ed6a5c75deaf360ead55dfea74f86a83c Mon Sep 17 00:00:00 2001 From: Fraxinas Date: Wed, 17 Nov 2010 12:10:24 +0100 Subject: get rid off evil absolute paths in dvdburn and nfiflash (fixes bug #620) --- lib/python/Plugins/Extensions/DVDBurn/DVDProject.py | 9 +++++++++ lib/python/Plugins/Extensions/DVDBurn/DreamboxDVD.ddvdp.xml | 6 +++--- lib/python/Plugins/Extensions/DVDBurn/Text_menu_boat.ddvdm.xml | 10 +++++----- .../Plugins/Extensions/DVDBurn/Thumbs_menu_clouds.ddvdm.xml | 10 +++++----- lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py | 4 ++-- 5 files changed, 24 insertions(+), 15 deletions(-) (limited to 'lib/python/Plugins') diff --git a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py index 7f755db4..6dbcd499 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py +++ b/lib/python/Plugins/Extensions/DVDBurn/DVDProject.py @@ -2,6 +2,7 @@ from Tools.Directories import fileExists from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigSubList import DVDTitle import xml.dom.minidom +from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS class ConfigColor(ConfigSequence): def __init__(self, default = [128,128,128]): @@ -125,6 +126,14 @@ class DVDProject: for key in self.filekeys: val = self.settings.dict()[key].getValue() if not fileExists(val): + if val[0] != "/": + if key.find("font") == 0: + val = resolveFilename(SCOPE_FONTS)+val + else: + val = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/"+val + if fileExists(val): + self.settings.dict()[key].setValue(val) + continue self.error += "\n%s '%s' not found" % (key, val) #except AttributeError: #print "loadProject AttributeError", self.error diff --git a/lib/python/Plugins/Extensions/DVDBurn/DreamboxDVD.ddvdp.xml b/lib/python/Plugins/Extensions/DVDBurn/DreamboxDVD.ddvdp.xml index 451e8a8b..4645260d 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/DreamboxDVD.ddvdp.xml +++ b/lib/python/Plugins/Extensions/DVDBurn/DreamboxDVD.ddvdp.xml @@ -3,11 +3,11 @@ diff --git a/lib/python/Plugins/Extensions/DVDBurn/Text_menu_boat.ddvdm.xml b/lib/python/Plugins/Extensions/DVDBurn/Text_menu_boat.ddvdm.xml index 0de7f4b6..bf6356a9 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/Text_menu_boat.ddvdm.xml +++ b/lib/python/Plugins/Extensions/DVDBurn/Text_menu_boat.ddvdm.xml @@ -3,17 +3,17 @@ Date: Wed, 17 Nov 2010 14:51:12 +0100 Subject: fix more nfiflash media paths to be non-absolute (#620) --- lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/python/Plugins') diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py index 34f87256..85ecc92d 100644 --- a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py @@ -16,7 +16,7 @@ from Components.MultiContent import MultiContentEntryText from Components.ScrollLabel import ScrollLabel from Components.Harddisk import harddiskmanager from Components.Task import Task, Job, job_manager, Condition -from Tools.Directories import fileExists, isMount, resolveFilename, SCOPE_HDD +from Tools.Directories import fileExists, isMount, resolveFilename, SCOPE_HDD, SCOPE_MEDIA from Tools.HardwareInfo import HardwareInfo from Tools.Downloader import downloadWithProgress from enigma import eConsoleAppContainer, gFont, RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP, eTimer @@ -391,7 +391,7 @@ class NFIDownload(Screen): self.box = HardwareInfo().get_device_name() self.feed_base = "http://www.dreamboxupdate.com/opendreambox" #/1.5/%s/images/" % self.box - self.usbmountpoint = "/mnt/usb/" + self.usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/" self.menulist = [] @@ -570,7 +570,7 @@ class NFIDownload(Screen): def ackedDestination(self): print "[ackedDestination]", self.branch, self.target_dir - self.container.setCWD("/mnt") + self.container.setCWD(resolveFilename(SCOPE_MEDIA)+"usb/") if self.target_dir[:8] == "/autofs/": self.target_dir = "/dev/" + self.target_dir[8:-1] @@ -796,9 +796,10 @@ def main(session, **kwargs): def filescan_open(list, session, **kwargs): dev = "/dev/" + (list[0].path).rsplit('/',1)[0][7:] - print "mounting device " + dev + " to /mnt/usb..." - system("mount "+dev+" /mnt/usb/ -o rw,sync") - session.open(NFIDownload,"/mnt/usb/") + print "mounting device " + dev + " to /media/usb..." + usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/" + system("mount %s %s -o rw,sync" % (dev, usbmountpoint)) + session.open(NFIDownload,usbmountpoint) def filescan(**kwargs): from Components.Scanner import Scanner, ScanPath -- cgit v1.2.3 From 0fe25bffe34c9a5fd50528d5ff2eb576b149163b Mon Sep 17 00:00:00 2001 From: acid-burn Date: Tue, 23 Nov 2010 15:59:02 +0100 Subject: SoftwareManager: take care of network availability inside SoftwareUpgrade and allow proper exiting. fixes #622 --- .../SystemPlugins/SoftwareManager/plugin.py | 30 +++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'lib/python/Plugins') diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index 707663a0..de127b03 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -1335,9 +1335,9 @@ class UpdatePlugin(Screen): self["slider"] = self.slider self.activityslider = Slider(0, 100) self["activityslider"] = self.activityslider - self.status = StaticText(_("Upgrading Dreambox... Please wait")) + self.status = StaticText(_("Please wait...")) self["status"] = self.status - self.package = StaticText() + self.package = StaticText(_("Verifying your internet connection...")) self["package"] = self.package self.oktext = _("Press OK on your remote control to continue.") @@ -1348,20 +1348,35 @@ class UpdatePlugin(Screen): self.activity = 0 self.activityTimer = eTimer() self.activityTimer.callback.append(self.doActivityTimer) - self.activityTimer.start(100, False) self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback) - self.updating = True - self.package.setText(_("Package list update")) - self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) + self.updating = False self["actions"] = ActionMap(["WizardActions"], { "ok": self.exit, "back": self.exit }, -1) + + iNetwork.checkNetworkState(self.checkNetworkCB) + self.onClose.append(self.cleanup) + + def cleanup(self): + iNetwork.stopPingConsole() + + def checkNetworkCB(self,data): + if data is not None: + if data <= 2: + self.updating = True + self.activityTimer.start(100, False) + self.package.setText(_("Package list update")) + self.status.setText(_("Upgrading Dreambox... Please wait")) + self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) + else: + self.package.setText(_("Your network is not working. Please try again.")) + self.status.setText(self.oktext) def doActivityTimer(self): self.activity += 1 @@ -1440,6 +1455,9 @@ class UpdatePlugin(Screen): self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?")) else: self.close() + else: + if not self.updating: + self.close() def exitAnswer(self, result): if result is not None and result: -- cgit v1.2.3 From 579da0e777130e0947e7e4cacad19cc4a154d978 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Thu, 25 Nov 2010 18:40:21 +0100 Subject: DVDPlayer/src/servicedvd.cpp: add possibility to override servicename for played dvd's. DVDPlayer/plugin.py: manually set servicename if playing from a dvd structure on hdd/networkmount. Small useability improvements. refs #439 --- lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 17 +++++++++++++++++ .../Plugins/Extensions/DVDPlayer/src/servicedvd.cpp | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'lib/python/Plugins') diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index 64b4ae50..063925e2 100755 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -39,7 +39,10 @@ class FileBrowser(Screen): currDir = "/media/dvd/" if not pathExists(currDir): currDir = "/" + if lastpath == "": # 'None' is magic to start at the list of mountpoints + currDir = None + inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/home", "/lib", "/proc", "/sbin", "/share", "/sys", "/tmp", "/usr", "/var"] self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso)", useServiceRef = True) self["filelist"] = self.filelist @@ -79,6 +82,12 @@ class FileBrowser(Screen): lastpath = (pathname.rstrip("/").rsplit("/",1))[0] print "lastpath video_ts.ifo=", lastpath self.close(pathname) + if fileExists(pathname+"VIDEO_TS/VIDEO_TS.IFO"): + print "dvd structure found, trying to open..." + lastpath = (pathname.rstrip("/").rsplit("/",1))[0] + print "lastpath video_ts.ifo=", lastpath + pathname += "VIDEO_TS" + self.close(pathname) else: lastpath = filename[0:filename.rfind("/")] print "lastpath directory=", lastpath @@ -625,6 +634,14 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP newref = eServiceReference(4369, 0, val) print "play", newref.toString() if curref is None or curref != newref: + if newref.toString().endswith("/VIDEO_TS") or newref.toString().endswith("/"): + names = newref.toString().rsplit("/",3) + if names[2].startswith("Disk ") or names[2].startswith("DVD "): + name = str(names[1]) + " - " + str(names[2]) + else: + name = names[2] + print "setting name to: ", self.service + newref.setName(str(name)) self.session.nav.playService(newref) self.service = self.session.nav.getCurrentService() print "self.service", self.service diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index 2ba53927..4ef00ab0 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -480,7 +480,10 @@ RESULT eServiceDVD::getName(std::string &name) if ( m_ddvd_titlestring[0] != '\0' ) name = m_ddvd_titlestring; else - name = m_ref.path; + if ( !m_ref.name.empty() ) + name = m_ref.name; + else + name = m_ref.path; return 0; } -- cgit v1.2.3 From 91e6234a82c8dda473c0112e99e151e3c324d786 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Fri, 3 Dec 2010 11:01:58 +0100 Subject: Extensions/DVDPlayer: add ".img" file extension to playable dvd formats. refs #439 --- lib/python/Plugins/Extensions/DVDPlayer/plugin.py | 2 +- lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/python/Plugins') diff --git a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py index 063925e2..e1ab3ef4 100755 --- a/lib/python/Plugins/Extensions/DVDPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/DVDPlayer/plugin.py @@ -43,7 +43,7 @@ class FileBrowser(Screen): currDir = None inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/home", "/lib", "/proc", "/sbin", "/share", "/sys", "/tmp", "/usr", "/var"] - self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso)", useServiceRef = True) + self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso|img)", useServiceRef = True) self["filelist"] = self.filelist self["FilelistActions"] = ActionMap(["SetupActions"], diff --git a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp index 4ef00ab0..5fbfb0aa 100644 --- a/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp +++ b/lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp @@ -32,6 +32,7 @@ eServiceFactoryDVD::eServiceFactoryDVD() { std::list extensions; extensions.push_back("iso"); + extensions.push_back("img"); sc->addServiceFactory(eServiceFactoryDVD::id, this, extensions); } } -- cgit v1.2.3 From 7ad025f87116448816a7531cfdac8bb1e0cffb0b Mon Sep 17 00:00:00 2001 From: acid-burn Date: Mon, 13 Dec 2010 12:39:41 +0100 Subject: SoftwareManager/plugin.py: allow autofs volumes to be selectable as backup location. fixes #629 --- lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/python/Plugins') diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index e1f3e1de..904fbb39 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -261,9 +261,6 @@ class UpdatePluginMenu(Screen): for x in parts: if not access(x[1], F_OK|R_OK|W_OK) or x[1] == '/': parts.remove(x) - for x in parts: - if x[1].startswith('/autofs/'): - parts.remove(x) if len(parts): self.session.openWithCallback(self.backuplocation_choosen, ChoiceBox, title = _("Please select medium to use as backup location"), list = parts) elif (currentEntry == "backupfiles"): @@ -278,14 +275,20 @@ class UpdatePluginMenu(Screen): def backupfiles_choosen(self, ret): self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value ) - + config.plugins.configurationbackup.backupdirs.save() + config.plugins.configurationbackup.save() + config.save() + def backuplocation_choosen(self, option): + oldpath = config.plugins.configurationbackup.backuplocation.getValue() if option is not None: config.plugins.configurationbackup.backuplocation.value = str(option[1]) config.plugins.configurationbackup.backuplocation.save() config.plugins.configurationbackup.save() config.save() - self.createBackupfolders() + newpath = config.plugins.configurationbackup.backuplocation.getValue() + if newpath != oldpath: + self.createBackupfolders() def runUpgrade(self, result): if result: -- cgit v1.2.3