Skip to content

Commit

Permalink
docs: updated doc strings in attck and configuration classes
Browse files Browse the repository at this point in the history
  • Loading branch information
MSAdministrator committed Jun 6, 2022
1 parent 3889d80 commit f367e45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pyattck/attck.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ def __init__(

@property
def enterprise(self):
"""Retrieve objects from the Enterprise MITRE ATT&CK Framework and
additional generated data which provides additional context.
"""Retrieve objects from the Enterprise MITRE ATT&CK Framework.
Returns:
Enterprise: Returns an Enterprise object
Expand Down
11 changes: 9 additions & 2 deletions pyattck/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,22 @@ def _save_json_data(self, force: bool = False) -> None:
return True

def get_data(self, value: str) -> dict:
"""Retrieves saved data based on key value in config.
Args:
value (str): A key value in our configuration file.
Returns:
dict: The dictionary object which was retrieved.
"""
data = getattr(self.config, value)
if is_url(data):
return self._download_url_data(data)
else:
return self._read_from_disk(getattr(self.config, value))

def __attrs_post_init__(self):
"""Contains options and configuration for pyattck
"""
"""Contains options and configuration for pyattck."""
if self.save_config:
self._save_to_disk(self.config_file_path, asdict(self.config))
self._save_json_data()
Expand Down

0 comments on commit f367e45

Please sign in to comment.