From 92ee19a1acc0d2b28a28a30717af11be6defd8ca Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Thu, 9 Jun 2022 15:21:24 +0200 Subject: [PATCH] environment.py : rtype and function doc (part) --- src/bootstraparse/modules/environment.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bootstraparse/modules/environment.py b/src/bootstraparse/modules/environment.py index dae7f84..fad2769 100644 --- a/src/bootstraparse/modules/environment.py +++ b/src/bootstraparse/modules/environment.py @@ -26,6 +26,10 @@ class Environment: """ def __init__(self): + """ + Initialises the environment, all parameters are set to None. + Set _wasInitialised to False for all parameters. + """ # mandatoryParameters self._mParams = { 'config': None, @@ -60,8 +64,10 @@ class Environment: def __getattr__(self, attribute): """ - Getter for all parameters. + Getter for all parameters, looks for super if the parameter is prefaced with an underscore. + Looks for mandatory parameters first, then secondary parameters. :param attribute: The name of the parameter to get. + :type attribute: str :return: The value of the parameter. """ if attribute[0] == "_": @@ -80,8 +86,9 @@ class Environment: def __setattr__(self, attribute, value): """ - Setter for all parameters. + Setter for all parameters, looks for super if the parameter is prefaced with an underscore. :param attribute: The name of the parameter to set. + :type attribute: str """ if attribute[0] == "_": super().__setattr__(attribute, value)