Esempio n. 1
0
def set_current_dir(path):
    """Set the current chooser directory.

    Args:
        path (fsnative)
    """

    assert isinstance(path, fsnative)
    data = fsn2bytes(path, "utf-8")
    config.setbytes("memory", "chooser_dir", data)
Esempio n. 2
0
    def _on_selection_changed(self, tree_selection):
        model, rows = tree_selection.get_selected_rows()
        selected_paths = [model[row][0] for row in rows]

        if selected_paths:
            data = fsn2bytes("\n".join(selected_paths), "utf-8")
        else:
            data = b""

        config.setbytes("browsers", "filesystem", data)
Esempio n. 3
0
    def _on_selection_changed(self, tree_selection):
        model, rows = tree_selection.get_selected_rows()
        selected_paths = [model[row][0] for row in rows]

        if selected_paths:
            data = fsn2bytes("\n".join(selected_paths), "utf-8")
        else:
            data = b""

        config.setbytes("browsers", "filesystem", data)
Esempio n. 4
0
def set_scan_dirs(dirs):
    """Saves a list of fs paths which should be scanned

    Args:
        list
    """

    assert all(isinstance(d, fsnative) for d in dirs)

    if is_windows():
        joined = fsnative(u":").join(dirs)
    else:
        joined = join_escape(dirs, fsnative(u":"))
    config.setbytes("settings", "scan", fsn2bytes(joined, "utf-8"))
Esempio n. 5
0
def set_scan_dirs(dirs):
    """Saves a list of fs paths which should be scanned

    Args:
        list
    """

    assert all(isinstance(d, fsnative) for d in dirs)

    if is_windows():
        joined = fsnative(u":").join(dirs)
    else:
        joined = join_escape(dirs, fsnative(u":"))
    config.setbytes("settings", "scan", fsn2bytes(joined, "utf-8"))