From b502b90158bed19b225d136c9a7fd34a0b486688 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 25 Jan 2012 15:44:50 +0100 Subject: [PATCH] Add float as setting type --- couchpotato/core/settings/__init__.py | 6 ++++++ couchpotato/static/scripts/page/settings.js | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/couchpotato/core/settings/__init__.py b/couchpotato/core/settings/__init__.py index 38a4a7a8..5b36e6ad 100644 --- a/couchpotato/core/settings/__init__.py +++ b/couchpotato/core/settings/__init__.py @@ -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() diff --git a/couchpotato/static/scripts/page/settings.js b/couchpotato/static/scripts/page/settings.js index 57c14e5f..18cd9604 100644 --- a/couchpotato/static/scripts/page/settings.js +++ b/couchpotato/static/scripts/page/settings.js @@ -469,6 +469,10 @@ Option.Int = new Class({ Extends: Option.String }); +Option.Float = new Class({ + Extends: Option.Int +}); + Option.Directory = new Class({ Extends: OptionBase,