forked from Griffintaur/News-At-Command-Line
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigReader.py
34 lines (27 loc) · 837 Bytes
/
configReader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
"""
Created on Jul 24 20:14:29 2016-2017
@author: Ankit Singh
"""
import yaml
# to do
# implement singleton pattern here
class ConfigurationReader():
__APIKEY = None
__WebsiteSupported = []
__Limit = None
def __init__(self):
with open("config.yml", 'r') as ymlfile:
cfg = yaml.load(ymlfile)
ConfigurationReader.__APIKEY = cfg['Apikey']
ConfigurationReader.__Limit = cfg['Limit']
ConfigurationReader.__WebsiteSupported = cfg['WebsiteSupported']
@staticmethod
def GetAPIKEY():
return ConfigurationReader.__APIKEY
@staticmethod
def GetLimit():
return ConfigurationReader.__Limit
@staticmethod
def GetWebsiteSupported():
return ConfigurationReader.__WebsiteSupported