mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-06 02:13:41 +03:00
Remember output folder on Windows.
This commit is contained in:
parent
6b34215d64
commit
6fb3931488
@ -62,12 +62,10 @@ class Config:
|
|||||||
mkdir(self.app_dir)
|
mkdir(self.app_dir)
|
||||||
|
|
||||||
self.handle = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, r'Software\%s' % appname)
|
self.handle = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, r'Software\%s' % appname)
|
||||||
try:
|
|
||||||
if not isdir(_winreg.QueryValue(self.handle, 'outdir')):
|
if not self.read('outdir') or not isdir(self.read('outdir')):
|
||||||
raise Exception()
|
|
||||||
except:
|
|
||||||
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, buf, CSIDL_PERSONAL, 0)
|
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, buf, CSIDL_PERSONAL, 0)
|
||||||
_winreg.SetValueEx(self.handle, 'outdir', 0, _winreg.REG_SZ, buf.value)
|
self.write('outdir', buf.value)
|
||||||
|
|
||||||
def read(self, key):
|
def read(self, key):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user