diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-04-30 11:08:42 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-04-30 11:08:42 +0300 |
commit | 342eb26779f02f11bb41ef9fa5900103ec22716c (patch) | |
tree | df324a509bd6f3fe2669f85806a827af72e37cc9 /yarnutils/vars.py | |
parent | 7c75bfe1115bba654b06b2ac6fd577c111287080 (diff) | |
download | cmdtest-342eb26779f02f11bb41ef9fa5900103ec22716c.tar.gz |
Add Variables.get() method
Diffstat (limited to 'yarnutils/vars.py')
-rw-r--r-- | yarnutils/vars.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/yarnutils/vars.py b/yarnutils/vars.py index 9404ffa..c10ed95 100644 --- a/yarnutils/vars.py +++ b/yarnutils/vars.py @@ -45,3 +45,6 @@ class Variables(object): def __setitem__(self, key, value): self._dict[key] = value self._save(self._dict) + + def get(self, key, default=None): + return self._dict.get(key, default) |