File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import os .path
10
10
from configparser import NoOptionError , RawConfigParser
11
+ from collections .abc import Generator
11
12
12
13
from xdg .BaseDirectory import load_config_paths # type: ignore[import-untyped]
13
14
@@ -40,12 +41,13 @@ def set_defaults(self):
40
41
self .set (self .section , "backoff_factor" , 0 )
41
42
42
43
@staticmethod
43
- def find_configs ():
44
+ def find_configs () -> Generator [ str ] :
44
45
# Handle Windows specifically
45
- if "APPDATA" in os .environ :
46
- win_path = os .path .join (os .environ ["APPDATA" ], "weblate.ini" )
47
- if os .path .exists (win_path ):
48
- yield win_path
46
+ for envname in ("APPDATA" , "LOCALAPPDATA" ):
47
+ if path := os .environ .get (envname ):
48
+ win_path = os .path .join (path , "weblate.ini" )
49
+ if os .path .exists (win_path ):
50
+ yield win_path
49
51
50
52
# Generic XDG paths
51
53
yield from load_config_paths ("weblate" )
You can’t perform that action at this time.
0 commit comments