def init(librarian): """May raise PlayerError""" try: driver = config.getbytes("settings", "xine_driver") except: driver = None return XinePlaylistPlayer(driver, librarian)
def get_scan_dirs(): """Returns a list of paths which should be scanned Returns: list """ joined_paths = bytes2fsn(config.getbytes("settings", "scan"), "utf-8") return [expanduser(p) for p in split_scan_dirs(joined_paths)]
def restore(self): data = config.getbytes("browsers", "filesystem", b"") try: paths = bytes2fsn(data, "utf-8") except ValueError: return if not paths: return self.__select_paths(paths.split("\n"))
def get_exclude_dirs(): """Returns a list of paths which should be ignored during scanning Returns: list """ paths = split_scan_dirs(bytes2fsn(config.getbytes("library", "exclude"), "utf-8")) return [expanduser(p) for p in paths]
def get_exclude_dirs(): """Returns a list of paths which should be ignored during scanning Returns: list """ paths = split_scan_dirs( bytes2fsn(config.getbytes("library", "exclude"), "utf-8")) return [expanduser(p) for p in paths]
def get_current_dir(): """Returns the currently active chooser directory path. The path might not actually exist. Returns: fsnative """ data = config.getbytes("memory", "chooser_dir", b"") try: path = bytes2fsn(data, "utf-8") or None except ValueError: path = None # the last user dir might not be there any more, try showing a parent # instead if path is not None: path = find_nearest_dir(path) if path is None: path = get_home_dir() return path
def get_exclude_dirs() -> Iterable[fsnative]: """:return: a list of paths which should be ignored during scanning""" paths = split_scan_dirs( bytes2fsn(config.getbytes("library", "exclude"), "utf-8")) return [expanduser(p) for p in paths] # type: ignore