mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-10 04:12:15 +03:00
Correct config examples
config.get() never returns int for consistency across platforms. Fixes #271
This commit is contained in:
parent
f65d2623ac
commit
d763e5931a
@ -64,7 +64,7 @@ def plugin_prefs(parent, cmdr, is_beta):
|
|||||||
"""
|
"""
|
||||||
Return a TK Frame for adding to the EDMC settings dialog.
|
Return a TK Frame for adding to the EDMC settings dialog.
|
||||||
"""
|
"""
|
||||||
this.mysetting = tk.IntVar(value=config.get("MyPluginSetting")) # Retrieve saved value from config
|
this.mysetting = tk.IntVar(value=config.getint("MyPluginSetting")) # Retrieve saved value from config
|
||||||
frame = nb.Frame(parent)
|
frame = nb.Frame(parent)
|
||||||
nb.Label(frame, text="Hello").grid()
|
nb.Label(frame, text="Hello").grid()
|
||||||
nb.Label(frame, text="Commander").grid()
|
nb.Label(frame, text="Commander").grid()
|
||||||
@ -80,7 +80,7 @@ def prefs_changed(cmdr, is_beta):
|
|||||||
"""
|
"""
|
||||||
Save settings.
|
Save settings.
|
||||||
"""
|
"""
|
||||||
config.setint('MyPluginSetting', this.mysetting.get()) # Store new value in config
|
config.set('MyPluginSetting', this.mysetting.getint()) # Store new value in config
|
||||||
```
|
```
|
||||||
|
|
||||||
## Display
|
## Display
|
||||||
|
@ -149,7 +149,7 @@ class Config:
|
|||||||
if hasattr(val, '__iter__'):
|
if hasattr(val, '__iter__'):
|
||||||
return list(val) # make writeable
|
return list(val) # make writeable
|
||||||
else:
|
else:
|
||||||
return val
|
return unicode(val)
|
||||||
|
|
||||||
def getint(self, key):
|
def getint(self, key):
|
||||||
try:
|
try:
|
||||||
@ -233,7 +233,7 @@ class Config:
|
|||||||
elif typ.value == REG_MULTI_SZ:
|
elif typ.value == REG_MULTI_SZ:
|
||||||
return [x for x in ctypes.wstring_at(buf, len(buf)-2).split(u'\x00')]
|
return [x for x in ctypes.wstring_at(buf, len(buf)-2).split(u'\x00')]
|
||||||
else:
|
else:
|
||||||
return buf.value
|
return unicode(buf.value)
|
||||||
|
|
||||||
def getint(self, key):
|
def getint(self, key):
|
||||||
typ = DWORD()
|
typ = DWORD()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user