Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Dec 6, 2023
1 parent f5f3f27 commit 218c910
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/zrb/task_env/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,43 @@ def __init__(

def get_name(self) -> str:
'''
# Description
Return environment's name.
'''
return self.__name

def get_os_name(self) -> Optional[str]:
'''
# Description
Return environment's os name.
'''
return self.__os_name

def get_default(self) -> str:
'''
# Description
Return environment's default value.
'''
return self.__default

def should_render(self) -> bool:
'''
# Description
Return boolean value, whether the value should be rendered or not.
'''
return self.__should_render

def get(self, prefix: str = '') -> str:
'''
# Description
Return environment value.
You can use prefix to distinguish 'DEV', 'PROD'
Example:
You can use prefix to distinguish development environment
(e.g., 'DEV', 'PROD')
# Example
```python
os.environ['DEV_SERVER'] = 'localhost'
os.environ['PROD_SERVER'] = 'example.com'
Expand Down
9 changes: 9 additions & 0 deletions src/zrb/task_env/env_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ def __init__(

def get_envs(self) -> List[Env]:
'''
# Description
Return list of Env based on the environment file.
# Example
```python
env_file = EnvFile(env_file='some_file.env')
envs: List[Env] = env_file.get_envs()
```
'''
if self.__env_list_fetched:
return self.__env_list
Expand Down

0 comments on commit 218c910

Please sign in to comment.