Skip to content

Commit

Permalink
Merge pull request #2146 from sopel-irc/remove-ConfigSection.get_list
Browse files Browse the repository at this point in the history
config.types: remove deprecated `ConfigSection.get_list()` method
  • Loading branch information
dgw authored Sep 15, 2021
2 parents 5521848 + 4d92301 commit eb6dd0b
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions sopel/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,29 +312,6 @@ def __setattr__(self, name, value):
value = ','.join(value)
self._parent.parser.set(self._name, name, value)

@tools.deprecated(
'No longer used; replaced by a dedicated ListAttribute type.'
'7.0', '8.0')
def get_list(self, name):
"""Legacy way of getting a list from a config value.
:param str name: name of the attribute to fetch and interpret as a list
:return: the value of ``name`` as a list
:rtype: list
.. deprecated:: 7.0
Use :class:`~.types.ListAttribute` when storing a list value.
This legacy method will be removed in Sopel 8.0.
"""
value = getattr(self, name)
if not value:
return []
if isinstance(value, str):
value = value.split(',')
# Keep the split value, so we don't have to keep doing this
setattr(self, name, value)
return value

def __getattr__(self, name):
if name in self.parser.sections():
items = self.parser.items(name)
Expand Down

0 comments on commit eb6dd0b

Please sign in to comment.