diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2019-07-10 17:12:00 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-08-05 11:46:12 -0400 |
commit | e635c5b43df0ed6f28c05429dae126d645ac8717 (patch) | |
tree | 5879cb4d24a00a357264196bcb5bf48bd3500bc7 /branding/scripts/provider.py | |
parent | 92ea8778813ddffe6187e0ce300638fdefe1bf5e (diff) |
[feat] windows templates
Diffstat (limited to 'branding/scripts/provider.py')
-rw-r--r-- | branding/scripts/provider.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/branding/scripts/provider.py b/branding/scripts/provider.py new file mode 100644 index 0000000..867007e --- /dev/null +++ b/branding/scripts/provider.py @@ -0,0 +1,32 @@ +import datetime +import os + + +def getDefaultProvider(config): + provider = os.environ.get('PROVIDER') + if provider: + print('[+] Got provider {} from environemnt'.format(provider)) + else: + print('[+] Using default provider from config file') + provider = config['default']['provider'] + return provider + + +def getProviderData(provider, config): + print("[+] Configured provider:", provider) + + c = config[provider] + d = dict() + + keys = ('name', 'applicationName', 'binaryName', + 'providerURL', 'tosURL', 'helpURL', + 'donateURL', 'apiURL', 'geolocationAPI', 'caCertString') + + for value in keys: + d[value] = c.get(value) + + d['timeStamp'] = '{:%Y-%m-%d %H:%M:%S}'.format( + datetime.datetime.now()) + + return d + |