-
Notifications
You must be signed in to change notification settings - Fork 2
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
DASH-1506: Emit Push notification events #66
Conversation
5227a90
to
15adf68
Compare
57316c1
to
c3bf606
Compare
c3bf606
to
a1356a2
Compare
715226b
to
0959074
Compare
bd0062b
to
a580b5e
Compare
def emit_microservice_message( # pylint: disable=keyword-arg-before-vararg | ||
self, exchange, routing_key, event_type, priority=0, *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.
pylint doesnt like having default value keyword arguments before *args, **kwargs
but I don't want to refactor the signature at this time.
@@ -1,5 +1,5 @@ | |||
try: | |||
from django.core.exceptions import ImproperlyConfigured | |||
from django.core.exceptions import ImproperlyConfigured # pylint: disable=unused-import |
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.
I'm not sure why this was necessary, but I think we can just import this without having the except
case once we update our django version.
args, a, kw, defaults = inspect.getargspec(func) # pylint: disable=deprecated-method | ||
|
||
signature = inspect.formatargspec(args, a, kw, defaults) | ||
signature = inspect.formatargspec(args, a, kw, defaults) # pylint: disable=deprecated-method | ||
is_bound_method = hasattr(func, '__self__') | ||
if is_bound_method: | ||
args = args[1:] # Omit 'self' | ||
callargs = inspect.formatargspec(args, a, kw, None) | ||
callargs = inspect.formatargspec(args, a, kw, None) # pylint: disable=deprecated-method |
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.
getargspec
and formatargspec
are deprecated in python 3.5, didn't want to spend time figuring out the new replacements
@@ -166,6 +166,7 @@ def activate(self, func): | |||
return get_wrapped(func, _wrapper_template, evaldict) | |||
|
|||
def _find_match(self, resource_type, **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.
this function was super unintuitive using a for/else loop. I didn't want to refactor it since I don't know how it will be have. This is my workaround.
Summary
Add emitter for push notification events