mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 18:47:09 -07:00
Fix flake8-bugbear B902 Invalid first argument used for instance method.
This commit is contained in:
parent
4c8e896bbb
commit
72140e939c
1 changed files with 7 additions and 7 deletions
|
@ -13,17 +13,17 @@ from core import logger
|
|||
|
||||
|
||||
class Section(configobj.Section, object):
|
||||
def isenabled(section):
|
||||
def isenabled(self):
|
||||
# checks if subsection enabled, returns true/false if subsection specified otherwise returns true/false in {}
|
||||
if not section.sections:
|
||||
if not self.sections:
|
||||
try:
|
||||
value = list(ConfigObj.find_key(section, 'enabled'))[0]
|
||||
value = list(ConfigObj.find_key(self, 'enabled'))[0]
|
||||
except Exception:
|
||||
value = 0
|
||||
if int(value) == 1:
|
||||
return section
|
||||
return self
|
||||
else:
|
||||
to_return = copy.deepcopy(section)
|
||||
to_return = copy.deepcopy(self)
|
||||
for section_name, subsections in to_return.items():
|
||||
for subsection in subsections:
|
||||
try:
|
||||
|
@ -40,8 +40,8 @@ class Section(configobj.Section, object):
|
|||
|
||||
return to_return
|
||||
|
||||
def findsection(section, key):
|
||||
to_return = copy.deepcopy(section)
|
||||
def findsection(self, key):
|
||||
to_return = copy.deepcopy(self)
|
||||
for subsection in to_return:
|
||||
try:
|
||||
value = list(ConfigObj.find_key(to_return[subsection], key))[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue