| Conditions | 4 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 19 | @lru_cache(maxsize=None) |
||
| 20 | def get_cached_setting_path(): |
||
| 21 | """Get the value of the #SETTINGSPATH# variable.""" |
||
| 22 | rainmeterpath = get_cached_program_path() |
||
| 23 | |||
| 24 | if not rainmeterpath: |
||
| 25 | return |
||
| 26 | |||
| 27 | # Check if Rainmeter.ini is in Rainmeter program directory |
||
| 28 | if os.path.exists(rainmeterpath + "Rainmeter.ini"): |
||
| 29 | logger.info("Rainmeter.ini found in " + rainmeterpath) |
||
| 30 | return rainmeterpath |
||
| 31 | |||
| 32 | else: # If not, look in %APPDATA%\Rainmeter\ |
||
| 33 | appdata = os.getenv("APPDATA") |
||
| 34 | if os.path.exists(os.path.join(appdata, "Rainmeter\\Rainmeter.ini")): |
||
| 35 | logger.info("Rainmeter.ini found in " + |
||
| 36 | os.path.join(appdata, "Rainmeter") + "\\") |
||
| 37 | return os.path.join(appdata, "Rainmeter") + "\\" |
||
| 38 | |||
| 39 | else: |
||
| 40 | logger.info("Rainmeter.ini could not be located.") |
||
| 41 | return None |
||
| 42 |