Skip to content

Commit

Permalink
add new set_env_from_dict method
Browse files Browse the repository at this point in the history
  • Loading branch information
trisongz committed Dec 2, 2021
1 parent c477c38 commit 6c7728f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lazycls/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ def loadEnvFile(path: Union[str, Path], override: bool = False):
_LoadedEnvFiles.add(path.name)
return True

def setEnvDict(data: Dict[str, Any], override: bool = False):
for k,v in data.items():
toEnv(name=k, value=v, override=override)

load_env_file = loadEnvFile
to_env = toEnv
set_env_from_dict = setEnvDict


__all__ = [
Expand All @@ -86,6 +91,8 @@ def loadEnvFile(path: Union[str, Path], override: bool = False):
'envInVals',
'envToStr',
'toEnv',
'setEnvDict',
'set_env_from_dict',
'loadEnvFile',
'load_env_file',
'to_env'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
if sys.version_info.major != 3:
raise RuntimeError("This package requires Python 3+")

version = '0.0.3'
version = '0.0.4'
pkg_name = 'lazycls'
gitrepo = 'trisongz/lazycls'
root = Path(__file__).parent
Expand Down

0 comments on commit 6c7728f

Please sign in to comment.