diff --git a/patacrep/songs/chordpro/ast.py b/patacrep/songs/chordpro/ast.py index 5cffbb86..cc0c0d63 100644 --- a/patacrep/songs/chordpro/ast.py +++ b/patacrep/songs/chordpro/ast.py @@ -39,6 +39,11 @@ class OrderedLifoDict: def __getitem__(self, key): return self._values[key] + def get(self, key, default=None): + if key not in self._keys: + return default + return self._values[key] + def _indent(string): """Return and indented version of argument.""" return "\n".join([" {}".format(line) for line in string.split('\n')])