Add float as setting type
This commit is contained in:
1 parent
f3887aaa44
commit
b502b90158
2 files changed
+10
No files matched your search
@@ -84,6 +84,12 @@ class Settings():
|
||||
except:
|
||||
return tryInt(self.p.get(section, option))
|
||||
|
||||
def getFloat(self, section, option):
|
||||
try:
|
||||
return self.p.getfloat(section, option)
|
||||
except:
|
||||
return tryInt(self.p.get(section, option))
|
||||
|
||||
def getUnicode(self, section, option):
|
||||
value = self.p.get(section, option)
|
||||
return toUnicode(value).strip()
|
||||
|
||||
@@ -469,6 +469,10 @@ Option.Int = new Class({
|
||||
Extends: Option.String
|
||||
});
|
||||
|
||||
Option.Float = new Class({
|
||||
Extends: Option.Int
|
||||
});
|
||||
|
||||
Option.Directory = new Class({
|
||||
|
||||
Extends: OptionBase,
|
||||
|
||||
Reference in new issue
Block a user