Declared logger attribute in HttpRequest as it won't be available to the subclasses otherwise

This commit is contained in:
Fabio Manganiello 2018-06-08 16:54:15 +02:00
parent f0bb2a20b0
commit 2bb6ed6867
2 changed files with 3 additions and 4 deletions

View file

@ -33,6 +33,7 @@ class HttpRequest(object):
self.bus = bus
self.skip_first_call = skip_first_call
self.last_request_timestamp = 0
self.logger = logging.getLogger(__name__)
if isinstance(args, self.HttpRequestArguments):
self.args = args

View file

@ -28,9 +28,7 @@ class RssUpdates(HttpRequest):
user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'
def __init__(self, url, title=None, headers=None, params=None, max_entries=None,
mercury_api_key=None, digest_format=None, *args, **kwargs):
super().__init__(*args, **kwargs)
mercury_api_key=None, digest_format=None, *argv, **kwargs):
self.url = url
self.title = title
self.max_entries = max_entries
@ -49,7 +47,7 @@ class RssUpdates(HttpRequest):
'params': params or {},
}
super().__init__(*args, skip_first_call=False, args=request_args, **kwargs)
super().__init__(skip_first_call=False, args=request_args, *argv, **kwargs)
def _get_or_create_source(self, session):
record = session.query(FeedSource).filter_by(url=self.url).first()