| Total Complexity | 6 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | import yaml |
||
| 4 | class Configure(object): |
||
| 5 | def __init__(self): |
||
| 6 | self.__config = None |
||
| 7 | |||
| 8 | def get_config(self): |
||
| 9 | return self.__config |
||
| 10 | |||
| 11 | def read_config(self, file_name='config.yaml'): |
||
| 12 | with open(file_name, 'r') as stream: |
||
| 13 | try: |
||
| 14 | self.__config = yaml.load(stream) |
||
| 15 | return True |
||
| 16 | except yaml.YAMLError: |
||
| 17 | #todo write error message to log/display |
||
| 18 | pass |
||
| 19 | |||
| 20 | return False |
||
| 21 | |||
| 22 | def set_config(self): |
||
| 23 | self.__config = None |
||
| 24 | |||
| 25 |