-
Notifications
You must be signed in to change notification settings - Fork 8
Sourcery refactored master branch #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,7 +208,12 @@ def verify_origin(self): | |
| url = urlparse.urlparse(origin) | ||
| host = url.hostname | ||
| port = url.port | ||
| return filter(lambda t: (t[0] == '*' or t[0].lower() == host.lower()) and (t[1] == '*' or t[1] == int(port)), origins) | ||
| return filter( | ||
| lambda t: ((t[0] == '*' or t[0].lower() == host.lower())) | ||
| and t[1] in ['*', int(port)], | ||
| origins, | ||
| ) | ||
|
|
||
|
Comment on lines
-211
to
+216
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function SocketIOProtocol.verify_origin refactored with the following changes:
|
||
| else: | ||
| return True | ||
|
|
||
|
|
@@ -218,11 +223,7 @@ def send(self, message, skip_queue=False): | |
| ensures it doesn't send if session | ||
| isn't fully open yet.""" | ||
|
|
||
| if self.asynchronous: | ||
| out_fh = self.output_handle | ||
| else: | ||
| out_fh = self | ||
|
|
||
| out_fh = self.output_handle if self.asynchronous else self | ||
|
Comment on lines
-221
to
+226
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function SocketIOProtocol.send refactored with the following changes:
|
||
| if isinstance(message, list): | ||
| for m in message: | ||
| out_fh.send(m) | ||
|
|
@@ -288,7 +289,6 @@ def _write(self, message): | |
| """Write method which all protocols must define to | ||
| indicate how to push to their wire""" | ||
| self.warning("[socketio protocol] Default call to _write. NOOP. [%s]" % message) | ||
| pass | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function SocketIOProtocol._write refactored with the following changes:
|
||
|
|
||
|
|
||
| def async_callback(self, callback, *args, **kwargs): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function SocketIOHandler.routes refactored with the following changes: