Total Complexity | 5 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Changes | 4 | ||
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: pass |
||
17 | |||
18 | return False |
||
19 |