mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-10-27 01:16:06 +03:00
Correct config examples
config.get() never returns int for consistency across platforms. Fixes #271
This commit is contained in:
1 parent
f65d2623ac
commit
d763e5931a
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user