fix: move self.config to the end of __init__

This commit is contained in:
YadominJinta 2021-10-20 10:16:06 +08:00
parent 0ab07f90ae
commit 242d5c5c5b

View File

@ -45,8 +45,6 @@ class Filter:
def __init__(self, user_key: str, mobile=False, config=None) -> None:
if config is None:
config = {}
else:
self.config = config
self.near = config['near'] if 'near' in config else ''
self.dark = config['dark'] if 'dark' in config else False
self.nojs = config['nojs'] if 'nojs' in config else False
@ -56,6 +54,7 @@ class Filter:
self.user_key = user_key
self.main_divs = ResultSet('')
self._elements = 0
self.config = config
def __getitem__(self, name):
return getattr(self, name)