From a32e6f2656689c28f92acbe0d9613c3eb80b5322 Mon Sep 17 00:00:00 2001 From: rjclark99 <167459563+rjclark99@users.noreply.github.com> Date: Sun, 28 Apr 2024 16:09:59 +0100 Subject: [PATCH] Enhanced self.APP_KEY and self.APP_SECRET grabbing. (#233) * added function getSettingStringStripped to utils and implemented in authorizers.py dropbox flow line 47 * added function getSettingStringStripped to utils and implemented in authorizers.py dropbox flow line 47 --- resources/lib/authorizers.py | 4 ++-- resources/lib/utils.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/lib/authorizers.py b/resources/lib/authorizers.py index 8504e65..ce87103 100644 --- a/resources/lib/authorizers.py +++ b/resources/lib/authorizers.py @@ -44,8 +44,8 @@ class DropboxAuthorizer: APP_SECRET = "" def __init__(self): - self.APP_KEY = utils.getSetting('dropbox_key') - self.APP_SECRET = utils.getSetting('dropbox_secret') + self.APP_KEY = utils.getSettingStringStripped('dropbox_key') + self.APP_SECRET = utils.getSettingStringStripped('dropbox_secret') def setup(self): result = True diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 246fa61..0614d47 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -30,6 +30,8 @@ def showNotification(message): def getSetting(name): return __Addon.getSetting(name) +def getSettingStringStripped(name): + return __Addon.getSettingString(name).strip() def getSettingBool(name): return bool(__Addon.getSettingBool(name))