-
Notifications
You must be signed in to change notification settings - Fork 96
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
adding slack and pushbullet #9
base: master
Are you sure you want to change the base?
Conversation
Thoughts on the code? |
Hey, sry for not responding sooner – I didn't yet find time to go over the whole PR. At a quick glance there seem to be some issues with it:
|
apikey = | ||
|
||
[slack] | ||
; set to true to enable Pushbullet notification support |
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.
Copy-paste error 😉
from collections import Counter, defaultdict | ||
from cStringIO import StringIO | ||
|
||
from slackclient import SlackClient |
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.
No need really to add this dependency for everyone - could instead make it optional and import it within send_slack
? (cf.send_email
)
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.
Good point, I don't use the slack client with my other code at this point. I use requests to make slack calls
@@ -156,7 +212,7 @@ def setup_logger(): | |||
root_logger.addHandler(console_logger) | |||
|
|||
if config["logging"]["file"]: | |||
max_log_size = min(config["logging"]["maxsize"], 0) * 1024 | |||
max_log_size = max(config["logging"]["maxsize"], 0) * 1024 |
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.
Looks accidental?
@@ -178,7 +234,7 @@ def setup_logger(): | |||
def main(): | |||
parser = argparse.ArgumentParser() | |||
parser.add_argument("-c", "--conf", | |||
default="snapraid-runner.conf", | |||
default="snapraid-runner ", |
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.
Looks accidental?
from collections import Counter, defaultdict | ||
from cStringIO import StringIO | ||
|
||
from slackclient import SlackClient |
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.
Good point, I don't use the slack client with my other code at this point. I use requests to make slack calls
I added slack and pushbullet