Flake8 add global __request__ to config

This commit is contained in:
Calum Lind 2014-09-22 12:03:18 +01:00
parent c115738535
commit 2f68092740
3 changed files with 8 additions and 8 deletions

View File

@ -276,7 +276,7 @@ class Auth(JSONComponent):
:returns: True if the session is valid, False if not.
:rtype: booleon
"""
return __request__.session_id is not None # NOQA
return __request__.session_id is not None
@export
def delete_session(self):
@ -287,7 +287,7 @@ class Auth(JSONComponent):
:type session_id: string
"""
config = component.get("DelugeWeb").config
del config["sessions"][__request__.session_id] # NOQA
del config["sessions"][__request__.session_id]
return True
@export(AUTH_LEVEL_NONE)
@ -301,7 +301,7 @@ class Auth(JSONComponent):
:rtype: string or False
"""
if self.check_password(password):
return self._create_session(__request__) # NOQA
return self._create_session(__request__)
else:
log.error('Login failed (ClientIP %s)', __request__.getClientIP()) # NOQA
log.error('Login failed (ClientIP %s)', __request__.getClientIP())
return False

View File

@ -975,7 +975,7 @@ class WebApi(JSONComponent):
:param event: The event name
:type event: string
"""
self.event_queue.add_listener(__request__.session_id, event) # NOQA
self.event_queue.add_listener(__request__.session_id, event)
@export
def deregister_event_listener(self, event):
@ -985,11 +985,11 @@ class WebApi(JSONComponent):
:param event: The event name
:type event: string
"""
self.event_queue.remove_listener(__request__.session_id, event) # NOQA
self.event_queue.remove_listener(__request__.session_id, event)
@export
def get_events(self):
"""
Retrieve the pending events for the session.
"""
return self.event_queue.get_events(__request__.session_id) # NOQA
return self.event_queue.get_events(__request__.session_id)

View File

@ -16,7 +16,7 @@ frameworks = CoreFoundation, Foundation, AppKit
[flake8]
max-line-length = 120
builtins = _
builtins = _,__request__
[isort]
known_standard_library=unicodedata