mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
ABrainz: replace lambda with operator
This commit is contained in:
parent
e5c46cf6ac
commit
b5f71a88e8
1 changed files with 3 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ from __future__ import (division, absolute_import, print_function,
|
|||
unicode_literals)
|
||||
|
||||
import requests
|
||||
import operator
|
||||
|
||||
from beets import plugins, ui
|
||||
|
||||
|
|
@ -57,9 +58,10 @@ class AcousticPlugin(plugins.BeetsPlugin):
|
|||
def fetch_info(log, items):
|
||||
"""Currently outputs MBID and corresponding request status code.
|
||||
"""
|
||||
|
||||
def get_value(map_path):
|
||||
try:
|
||||
return reduce(lambda d, k: d[k], map_path, data)
|
||||
return reduce(operator.getitem, map_path, data)
|
||||
except KeyError:
|
||||
log.debug('Invalid Path: {}', map_path)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue