def checkStoragePath(self): tmppath = config.mediaportal.storagepath.value if tmppath != "/tmp" and tmppath != "/media/ba": if os_path.islink(tmppath): tmppath = os_readlink(tmppath) loopcount = 0 while not os_path.ismount(tmppath): loopcount += 1 tmppath = os_path.dirname(tmppath) if tmppath == "/" or tmppath == "" or loopcount > 50: self.session.open( MessageBox, _("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!" ), type=MessageBox.TYPE_INFO, timeout=20) return False os_system("mkdir -p " + config.mediaportal.storagepath.value) if not os_path.exists(config.mediaportal.storagepath.value): self.session.open( MessageBox, _("Error: No write permission to create cache-folders. Check your Cache-Folder Settings!" ), type=MessageBox.TYPE_INFO, timeout=20) return False else: return True
def checkStoragePath(self): tmppath = config.mediaportal.storagepath.value if tmppath != "/tmp" and tmppath != "/media/ba": if os_path.islink(tmppath): tmppath = os_readlink(tmppath) loopcount = 0 while not os_path.ismount(tmppath): loopcount += 1 tmppath = os_path.dirname(tmppath) if tmppath == "/" or tmppath == "" or loopcount > 50: self.session.open(MessageBoxExt, _("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!"), type=MessageBoxExt.TYPE_INFO, timeout=20) return False os_system("mkdir -p "+config.mediaportal.storagepath.value) if not os_path.exists(config.mediaportal.storagepath.value): self.session.open(MessageBoxExt, _("Error: No write permission to create cache-folders. Check your Cache-Folder Settings!"), type=MessageBoxExt.TYPE_INFO, timeout=20) return False else: return True