def show_files_win32(path, files): """Takes a path to a directory and a list of filenames in that directory to display. Returns True on success. """ assert os.name == "nt" assert is_fsnative(path) assert all(is_fsnative(f) for f in files) from quodlibet.util.windows import open_folder_and_select_items try: open_folder_and_select_items(path, files) except WindowsError: return False return True
def show_files_win32(path, files): """Takes a path to a directory and a list of filenames in that directory to display. Returns True on success. """ assert os.name == "nt" assert isinstance(path, fsnative) assert all(isinstance(f, fsnative) for f in files) from quodlibet.util.windows import open_folder_and_select_items try: open_folder_and_select_items(path, files) except WindowsError: return False return True
def _show_files_win32(dirname, entries): if not is_windows(): raise BrowseError("windows only") if not entries: # open_folder_and_select_items will open the parent if no items # are passed, so execute explorer directly for that case try: if subprocess.call(["explorer", dirname]) != 0: raise EnvironmentError("explorer error return status") except EnvironmentError as e: raise BrowseError(e) else: from quodlibet.util.windows import open_folder_and_select_items try: open_folder_and_select_items(dirname, entries) except WindowsError as e: raise BrowseError(e)
def _show_files_win32(dirname, entries): if not is_windows(): raise BrowseError("windows only") if not entries: # open_folder_and_select_items will open the parent if no items # are passed, so execute explorer directly for that case try: if subprocess.call(["explorer", dirname]) != 0: raise EnvironmentError("explorer error return status") except EnvironmentError as e: raise BrowseError(e) else: from quodlibet.util.windows import open_folder_and_select_items try: open_folder_and_select_items(dirname, []) except WindowsError as e: raise BrowseError(e)