1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Correct config examples

config.get() never returns int for consistency across platforms.
Fixes #271
This commit is contained in:
Jonathan Harris 2017-12-03 12:39:01 +00:00
parent f65d2623ac
commit d763e5931a
2 changed files with 4 additions and 4 deletions

View File

@ -64,7 +64,7 @@ def plugin_prefs(parent, cmdr, is_beta):
"""
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)
nb.Label(frame, text="Hello").grid()
nb.Label(frame, text="Commander").grid()
@ -80,7 +80,7 @@ def prefs_changed(cmdr, is_beta):
"""
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

View File

@ -149,7 +149,7 @@ class Config:
if hasattr(val, '__iter__'):
return list(val) # make writeable
else:
return val
return unicode(val)
def getint(self, key):
try:
@ -233,7 +233,7 @@ class Config:
elif typ.value == REG_MULTI_SZ:
return [x for x in ctypes.wstring_at(buf, len(buf)-2).split(u'\x00')]
else:
return buf.value
return unicode(buf.value)
def getint(self, key):
typ = DWORD()