File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 11import platform
2+ from collections .abc import Iterator
23from pathlib import Path
34
45from click import get_app_dir
@@ -32,14 +33,10 @@ def qutebrowser_data_dir() -> Path:
3233 return Path (get_app_dir ("qutebrowser" , roaming = True ))
3334
3435
35- def qutebrowser_config_dirs () -> list [Path ]:
36- # deduplicate while maintaining order
37- return list (
38- dict .fromkeys (
39- [
40- Path (get_app_dir ("qutebrowser" , roaming = True )),
41- xdg_config_home () / "qutebrowser" ,
42- Path .home () / ".qutebrowser" ,
43- ]
44- )
45- )
36+ def qutebrowser_config_dirs () -> Iterator [Path ]:
37+ app_dir = Path (get_app_dir ("qutebrowser" , roaming = True ))
38+ yield app_dir
39+ xdg_dir = xdg_config_home () / "qutebrowser"
40+ if xdg_dir != app_dir :
41+ yield xdg_dir
42+ yield Path .home () / ".qutebrowser"
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ def find_qutebrowser_config_dir(qb_config_dir: Path | None) -> Path | None:
9292 dirs = (
9393 [qb_config_dir , qb_config_dir / "config" ]
9494 if qb_config_dir
95- else qutebrowser_config_dirs ()
95+ else list ( qutebrowser_config_dirs () )
9696 )
9797 for config_dir in dirs :
9898 if (config_dir / config_file ).exists ():
You can’t perform that action at this time.
0 commit comments