-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from rohanpsingh/topic/new-updates
Massive new updates
- Loading branch information
Showing
30 changed files
with
1,542 additions
and
966 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import yaml | ||
|
||
class Configuration: | ||
def __init__(self, **kwargs): | ||
for key, value in kwargs.items(): | ||
if isinstance(value, dict): | ||
setattr(self, key, Configuration(**value)) | ||
else: | ||
setattr(self, key, value) | ||
|
||
def __repr__(self): | ||
return str(self.__dict__) | ||
|
||
def load_yaml(file_path): | ||
with open(file_path, 'r') as file: | ||
config_data = yaml.safe_load(file) | ||
return Configuration(**config_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.