def update_music_tree(self, tree=None, number_of_page=0): if not tree: tree = self.tree logging.info("Update music tree" + str(FCache().music_paths[number_of_page])) tree.clear_tree() FCache().cache_music_tree_beans[number_of_page] = [] all = [] all = get_all_music_by_paths(FCache().music_paths[number_of_page], self) for bean in all: FCache().cache_music_tree_beans[number_of_page].append(bean) try: self.perspective.hide_add_button() except AttributeError: logging.warn("Object perspective not exists yet") if not all: tree.is_empty = True try: self.perspective.show_add_button() except AttributeError: logging.warn("Object perspective not exists yet") all.append(FModel(_("Music not found in folder(s):"))) for path in FCache().music_paths[number_of_page]: all.append(FModel(path).add_is_file(True)) else: tree.is_empty = False tree.append_all(all) tree.ext_width = tree.ext_column.get_width()
def update_music_tree(self, tree=None, number_of_page=0): if not tree: tree = self.tree logging.info("Update music tree" + str(FCache().music_paths[number_of_page])) tree.clear_tree() FCache().cache_music_tree_beans[number_of_page] = [] all = [] all = get_all_music_by_paths(FCache().music_paths[number_of_page], self) for bean in all: FCache().cache_music_tree_beans[number_of_page].append(bean) try: self.perspective.hide_add_button() except AttributeError: logging.warn("Object perspective not exists yet") if not all: tree.is_empty = True try: self.perspective.show_add_button() except AttributeError: logging.warn("Object perspective not exists yet") all.append(FModel(_("Music not found in folder(s):"))) for path in FCache().music_paths[number_of_page]: all.append(FModel(path).add_is_file(True)) else: tree.is_empty = False tree.append_all(all) tree.ext_width = tree.ext_column.get_width()
def update_music_tree(self, tree, number_of_page=0): logging.info("Update music tree" + str(FCache().music_paths[number_of_page])) tree.clear_tree() FCache().cache_music_tree_beans[number_of_page] = [] all = [] all = get_all_music_by_paths(FCache().music_paths[number_of_page], self) for bean in all: FCache().cache_music_tree_beans[number_of_page].append(bean) try: self.perspective.hide_add_button() except AttributeError: logging.warn("Object perspective not exists yet") if not all: try: self.perspective.show_add_button() except AttributeError: logging.warn("Object perspective not exists yet") tree.append_all(all) tree.ext_width = tree.ext_column.get_width()
def task(): path = paths[0] list = path.split("/") FC().last_dir = path[:path.rfind("/")] name = list[len(list) - 1] parent = FModel(name) self.append_to_new_notebook(name, []) all_beans = [] all_beans.append(parent) for bean in get_all_music_by_paths(paths, self): if not bean.is_file: bean.parent(parent).add_is_file(False) all_beans.append(bean) if all_beans: self.append_to_current_notebook(all_beans) else: self.append([self.SearchCriteriaBeen(_("Nothing found to play in the folder(s)") + paths[0])])
def task(): path = paths[0] list = path.split("/") FC().last_dir = path[:path.rfind("/")] name = list[len(list) - 1] parent = FModel(name) self.append_to_new_notebook(name, []) all_beans = [] all_beans.append(parent) for bean in get_all_music_by_paths(paths, self): if not bean.is_file: bean.parent(parent).add_is_file(False) all_beans.append(bean) if all_beans: self.append_to_current_notebook(all_beans) else: self.append([ self.SearchCriteriaBeen( _("Nothing found to play in the folder(s)") + paths[0]) ])