mirror of
https://github.com/beetbox/beets.git
synced 2026-01-28 19:16:10 +01:00
config: Add suport for 'key in config' syntax
We can use this instead of the cumbersome `config[key].exists()`.
This commit is contained in:
parent
7958469b25
commit
5279016db4
1 changed files with 3 additions and 0 deletions
|
|
@ -220,6 +220,9 @@ class ConfigView(object):
|
|||
"""
|
||||
self.set({key: value})
|
||||
|
||||
def __contains__(self, key):
|
||||
return self[key].exists()
|
||||
|
||||
def set_args(self, namespace):
|
||||
"""Overlay parsed command-line arguments, generated by a library
|
||||
like argparse or optparse, onto this view's value.
|
||||
|
|
|
|||
Loading…
Reference in a new issue