Start refinement of CREST utilities:

* Add preference page which gives option of implicit grant or user client details
* Improve CREST service
* Changes in pycrest which make things a little easier
This commit is contained in:
blitzmann
2015-10-21 23:10:06 -04:00
parent 69a4e42ab0
commit e0f99ee133
10 changed files with 176 additions and 95 deletions

View File

@@ -263,4 +263,30 @@ class UpdateSettings():
def set(self, type, value):
self.serviceUpdateSettings[type] = value
class CRESTSettings():
_instance = None
@classmethod
def getInstance(cls):
if cls._instance is None:
cls._instance = CRESTSettings()
return cls._instance
def __init__(self):
# mode
# 0 - Implicit authentication
# 1 - User-supplied client details
serviceCRESTDefaultSettings = {"mode": 0, "clientID": "", "clientSecret": ""}
self.serviceCRESTSettings = SettingsProvider.getInstance().getSettings("pyfaServiceCRESTSettings", serviceCRESTDefaultSettings)
def get(self, type):
return self.serviceCRESTSettings[type]
def set(self, type, value):
self.serviceCRESTSettings[type] = value
# @todo: migrate fit settings (from fit service) here?