From f66032677ce69e91b6c977b7b4d3e734c5b4aa08 Mon Sep 17 00:00:00 2001 From: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Wed, 20 Apr 2022 13:12:08 -0700 Subject: [PATCH] pylint --- music21/metadata/__init__.py | 56 ++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/music21/metadata/__init__.py b/music21/metadata/__init__.py index 1fa1353be9..4ba3da7b01 100644 --- a/music21/metadata/__init__.py +++ b/music21/metadata/__init__.py @@ -543,10 +543,14 @@ def addItems(self, >>> md.addItems('title', [metadata.Text('Caveat Emptor', language='la'), ... metadata.Text('Buyer Beware', language='en')]) >>> titles = md.getItems('title') - >>> titles - [, ] + >>> len(titles) + 2 + >>> titles[0] + >>> titles[0].language 'la' + >>> titles[1] + >>> titles[1].language 'en' >>> md.getItem('title') @@ -600,20 +604,48 @@ def setItems(self, >>> md = metadata.Metadata() >>> md.setItems('librettist', [metadata.Text('Joe Libretto'), ... metadata.Text('John Smith')]) - >>> md.getItems('librettist') # uniqueName - [, ] - >>> md.getItems('LBT', namespace='marcrel') # name, namespace - [, ] - >>> md.getItems('lbt', namespace='marcrel') # abbrevCode, namespace - [, ] - >>> md.getItems('marcrel:LBT') # 'namespace:name' - [, ] + + >>> items = md.getItems('librettist') # uniqueName + >>> len(items) + 2 + >>> items[0] + + >>> items[1] + + + >>> items = md.getItems('LBT', namespace='marcrel') # name, namespace + >>> len(items) + 2 + >>> items[0] + + >>> items[1] + + >>> items = md.getItems('lbt', namespace='marcrel') # abbrevCode, namespace + >>> len(items) + 2 + >>> items[0] + + >>> items[1] + + >>> items = md.getItems('marcrel:LBT') # 'namespace:name' + >>> len(items) + 2 + >>> items[0] + + >>> items[1] + >>> md.librettists # backward compatible access ['Joe Libretto', 'John Smith'] + >>> md.librettist # backward compatible access 'Joe Libretto' - >>> md.contributors # backward compatible access - [, ] + + >>> items = md.contributors # backward compatible access + >>> len(items) + 2 + >>> items[0] + + >>> items[1] ''' self._setItems(key, valueList, namespace)