mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -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):
|
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 {}
|
# checks if subsection enabled, returns true/false if subsection specified otherwise returns true/false in {}
|
||||||
if not section.sections:
|
if not self.sections:
|
||||||
try:
|
try:
|
||||||
value = list(ConfigObj.find_key(section, 'enabled'))[0]
|
value = list(ConfigObj.find_key(self, 'enabled'))[0]
|
||||||
except Exception:
|
except Exception:
|
||||||
value = 0
|
value = 0
|
||||||
if int(value) == 1:
|
if int(value) == 1:
|
||||||
return section
|
return self
|
||||||
else:
|
else:
|
||||||
to_return = copy.deepcopy(section)
|
to_return = copy.deepcopy(self)
|
||||||
for section_name, subsections in to_return.items():
|
for section_name, subsections in to_return.items():
|
||||||
for subsection in subsections:
|
for subsection in subsections:
|
||||||
try:
|
try:
|
||||||
|
@ -40,8 +40,8 @@ class Section(configobj.Section, object):
|
||||||
|
|
||||||
return to_return
|
return to_return
|
||||||
|
|
||||||
def findsection(section, key):
|
def findsection(self, key):
|
||||||
to_return = copy.deepcopy(section)
|
to_return = copy.deepcopy(self)
|
||||||
for subsection in to_return:
|
for subsection in to_return:
|
||||||
try:
|
try:
|
||||||
value = list(ConfigObj.find_key(to_return[subsection], key))[0]
|
value = list(ConfigObj.find_key(to_return[subsection], key))[0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue