コード例 #1
0
ファイル: notification.py プロジェクト: orenshk/Prometheus
def push_note(subject, body):
    config = config_from_file(key='pushbullet')
    pb = Pushbullet(api_key=config['api_key'])
    for channel in pb.channels:
        if channel.channel_tag == config['channel']:
            channel.push_note(subject, body)
コード例 #2
0
ファイル: notification.py プロジェクト: orenshk/Prometheus
def email(to_addrs, subject, body, service='gmail'):
    config = config_from_file(key='gmail')
    if service == 'gmail':
        _gmail(gmail_addr=config['username'], to_addrs=to_addrs, subject=subject, body=body, password=config['password'])
    else:
        print('Unsupported mail service {}'.format(service))