How to use notifier method in Slash

Best Python code snippet using slash

jingle.gyp

Source:jingle.gyp Github

copy

Full Screen

1# Copyright (c) 2012 The Chromium Authors. All rights reserved.2# Use of this source code is governed by a BSD-style license that can be3# found in the LICENSE file.4{5 'includes': [6 'jingle.gypi',7 ],8 'variables': {9 'chromium_code': 1,10 }, # variables11 'conditions': [12 ['enable_webrtc==1 or OS!="android"', {13 'targets': [14 # A library of various utils for integration with libjingle.15 # GN version: //jingle:jingle_glue16 {17 'target_name': 'jingle_glue',18 'type': 'static_library',19 'sources': [20 '<@(jingle_glue_sources)',21 ],22 'dependencies': [23 '../base/base.gyp:base',24 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',25 '../net/net.gyp:net',26 '../third_party/libjingle/libjingle.gyp:libjingle',27 ],28 'export_dependent_settings': [29 '../third_party/libjingle/libjingle.gyp:libjingle',30 ],31 },32 # A library for sending and receiving peer-issued notifications.33 #34 # TODO(akalin): Separate out the XMPP stuff from this library into35 # its own library.36 #37 # GN version: //jingle:notifier38 {39 'target_name': 'notifier',40 'type': 'static_library',41 'sources': [42 'notifier/base/const_communicator.h',43 'notifier/base/gaia_constants.cc',44 'notifier/base/gaia_constants.h',45 'notifier/base/gaia_token_pre_xmpp_auth.cc',46 'notifier/base/gaia_token_pre_xmpp_auth.h',47 'notifier/base/notification_method.h',48 'notifier/base/notification_method.cc',49 'notifier/base/notifier_options.cc',50 'notifier/base/notifier_options.h',51 'notifier/base/notifier_options_util.cc',52 'notifier/base/notifier_options_util.h',53 'notifier/base/server_information.cc',54 'notifier/base/server_information.h',55 'notifier/base/weak_xmpp_client.cc',56 'notifier/base/weak_xmpp_client.h',57 'notifier/base/xmpp_connection.cc',58 'notifier/base/xmpp_connection.h',59 'notifier/communicator/connection_settings.cc',60 'notifier/communicator/connection_settings.h',61 'notifier/communicator/login.cc',62 'notifier/communicator/login.h',63 'notifier/communicator/login_settings.cc',64 'notifier/communicator/login_settings.h',65 'notifier/communicator/single_login_attempt.cc',66 'notifier/communicator/single_login_attempt.h',67 'notifier/listener/non_blocking_push_client.cc',68 'notifier/listener/non_blocking_push_client.h',69 'notifier/listener/notification_constants.cc',70 'notifier/listener/notification_constants.h',71 'notifier/listener/notification_defines.cc',72 'notifier/listener/notification_defines.h',73 'notifier/listener/push_client_observer.cc',74 'notifier/listener/push_client_observer.h',75 'notifier/listener/push_client.cc',76 'notifier/listener/push_client.h',77 'notifier/listener/push_notifications_listen_task.cc',78 'notifier/listener/push_notifications_listen_task.h',79 'notifier/listener/push_notifications_send_update_task.cc',80 'notifier/listener/push_notifications_send_update_task.h',81 'notifier/listener/push_notifications_subscribe_task.cc',82 'notifier/listener/push_notifications_subscribe_task.h',83 'notifier/listener/send_ping_task.cc',84 'notifier/listener/send_ping_task.h',85 'notifier/listener/xml_element_util.cc',86 'notifier/listener/xml_element_util.h',87 'notifier/listener/xmpp_push_client.cc',88 'notifier/listener/xmpp_push_client.h',89 ],90 'defines' : [91 '_CRT_SECURE_NO_WARNINGS',92 ],93 'dependencies': [94 '../base/base.gyp:base',95 '../net/net.gyp:net',96 '../third_party/expat/expat.gyp:expat',97 '../third_party/libjingle/libjingle.gyp:libjingle',98 '../url/url.gyp:url_lib',99 'jingle_glue',100 ],101 'export_dependent_settings': [102 '../third_party/libjingle/libjingle.gyp:libjingle',103 ],104 },105 # GN version: //jingle:notifier_test_util106 {107 'target_name': 'notifier_test_util',108 'type': 'static_library',109 'sources': [110 'notifier/base/fake_base_task.cc',111 'notifier/base/fake_base_task.h',112 'notifier/listener/fake_push_client.cc',113 'notifier/listener/fake_push_client.h',114 'notifier/listener/fake_push_client_observer.cc',115 'notifier/listener/fake_push_client_observer.h',116 ],117 'dependencies': [118 'notifier',119 '../base/base.gyp:base',120 '../testing/gmock.gyp:gmock',121 ],122 },123 # GN version: //jingle:jingle_unittests124 {125 'target_name': 'jingle_unittests',126 'type': 'executable',127 'sources': [128 'glue/channel_socket_adapter_unittest.cc',129 'glue/chrome_async_socket_unittest.cc',130 'glue/fake_ssl_client_socket_unittest.cc',131 'glue/jingle_glue_mock_objects.cc',132 'glue/jingle_glue_mock_objects.h',133 'glue/logging_unittest.cc',134 'glue/mock_task.cc',135 'glue/mock_task.h',136 'glue/proxy_resolving_client_socket_unittest.cc',137 'glue/pseudotcp_adapter_unittest.cc',138 'glue/task_pump_unittest.cc',139 'glue/thread_wrapper_unittest.cc',140 'notifier/base/weak_xmpp_client_unittest.cc',141 'notifier/base/xmpp_connection_unittest.cc',142 'notifier/communicator/connection_settings_unittest.cc',143 'notifier/communicator/login_settings_unittest.cc',144 'notifier/communicator/single_login_attempt_unittest.cc',145 'notifier/listener/non_blocking_push_client_unittest.cc',146 'notifier/listener/notification_defines_unittest.cc',147 'notifier/listener/push_client_unittest.cc',148 'notifier/listener/push_notifications_send_update_task_unittest.cc',149 'notifier/listener/push_notifications_subscribe_task_unittest.cc',150 'notifier/listener/send_ping_task_unittest.cc',151 'notifier/listener/xml_element_util_unittest.cc',152 'notifier/listener/xmpp_push_client_unittest.cc',153 ],154 'conditions': [155 ['OS=="android"', {156 'sources!': [157 # TODO(jrg):158 # EXPECT_DEBUG_DEATH() uses features not enabled.159 # Should we -std=c++0x or -std=gnu++0x?160 'glue/chrome_async_socket_unittest.cc',161 'notifier/base/xmpp_connection_unittest.cc',162 ],163 }]],164 'include_dirs': [165 '..',166 ],167 'dependencies': [168 'jingle_glue',169 'notifier',170 'notifier_test_util',171 '../base/base.gyp:base',172 '../base/base.gyp:run_all_unittests',173 '../base/base.gyp:test_support_base',174 '../net/net.gyp:net',175 '../net/net.gyp:net_test_support',176 '../testing/gmock.gyp:gmock',177 '../testing/gtest.gyp:gtest',178 '../third_party/libjingle/libjingle.gyp:libjingle',179 ],180 },181 ],182 }, { # enable_webrtc!=1 and OS=="android"183 'targets': [184 # Stub targets as Android doesn't use libjingle when webrtc is disabled.185 {186 'target_name': 'jingle_glue',187 'type': 'none',188 },189 {190 'target_name': 'jingle_glue_test_util',191 'type': 'none',192 },193 # GN version: //jingle:notifier194 {195 'target_name': 'notifier',196 'type': 'static_library',197 'sources': [198 'notifier/base/gaia_constants.cc',199 'notifier/base/gaia_constants.h',200 'notifier/base/notification_method.h',201 'notifier/base/notification_method.cc',202 'notifier/base/notifier_options.cc',203 'notifier/base/notifier_options.h',204 ],205 'dependencies': [206 '../base/base.gyp:base',207 '../net/net.gyp:net',208 ],209 },210 {211 'target_name': 'notifier_test_util',212 'type': 'none',213 },214 ],215 }],216 ],...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1# coding=utf-82from __future__ import unicode_literals3import logging4import socket5from medusa import app6from medusa.common import (7 NOTIFY_SNATCH,8 NOTIFY_SNATCH_PROPER,9 notifyStrings,10)11from medusa.logger.adapters.style import BraceAdapter12from medusa.notifiers import (13 boxcar2,14 discord,15 emailnotify,16 emby,17 freemobile,18 growl,19 join,20 kodi,21 libnotify,22 nmj,23 nmjv2,24 plex,25 prowl,26 pushalot,27 pushbullet,28 pushover,29 pytivo,30 slack,31 synoindex,32 synology_notifier,33 telegram,34 trakt,35 tweet,36)37from requests.exceptions import RequestException38log = BraceAdapter(logging.getLogger(__name__))39log.logger.addHandler(logging.NullHandler())40# home theater / nas41kodi_notifier = kodi.Notifier()42plex_notifier = plex.Notifier()43emby_notifier = emby.Notifier()44nmj_notifier = nmj.Notifier()45nmjv2_notifier = nmjv2.Notifier()46synoindex_notifier = synoindex.Notifier()47synology_notifier = synology_notifier.Notifier()48pytivo_notifier = pytivo.Notifier()49# devices50growl_notifier = growl.Notifier()51prowl_notifier = prowl.Notifier()52libnotify_notifier = libnotify.Notifier()53pushover_notifier = pushover.Notifier()54boxcar2_notifier = boxcar2.Notifier()55pushalot_notifier = pushalot.Notifier()56pushbullet_notifier = pushbullet.Notifier()57join_notifier = join.Notifier()58freemobile_notifier = freemobile.Notifier()59telegram_notifier = telegram.Notifier()60discord_notifier = discord.Notifier()61# social62twitter_notifier = tweet.Notifier()63trakt_notifier = trakt.Notifier()64email_notifier = emailnotify.Notifier()65slack_notifier = slack.Notifier()66notifiers = [67 libnotify_notifier, # Libnotify notifier goes first because it doesn't involve blocking on network activity.68 kodi_notifier,69 plex_notifier,70 nmj_notifier,71 nmjv2_notifier,72 synoindex_notifier,73 synology_notifier,74 pytivo_notifier,75 growl_notifier,76 freemobile_notifier,77 telegram_notifier,78 discord_notifier,79 prowl_notifier,80 pushover_notifier,81 boxcar2_notifier,82 pushalot_notifier,83 pushbullet_notifier,84 join_notifier,85 twitter_notifier,86 trakt_notifier,87 email_notifier,88 slack_notifier89]90def notify_download(ep_obj):91 for n in notifiers:92 try:93 n.notify_download(ep_obj)94 except (RequestException, socket.gaierror, socket.timeout) as error:95 log.debug(u'Unable to send download notification. Error: {0!r}', error)96def notify_subtitle_download(ep_obj, lang):97 for n in notifiers:98 try:99 n.notify_subtitle_download(ep_obj, lang)100 except (RequestException, socket.gaierror, socket.timeout) as error:101 log.debug(u'Unable to send subtitle download notification. Error: {0!r}', error)102def notify_snatch(ep_obj, result):103 ep_name = ep_obj.pretty_name_with_quality()104 is_proper = bool(result.proper_tags)105 title = notifyStrings[(NOTIFY_SNATCH, NOTIFY_SNATCH_PROPER)[is_proper]]106 has_peers = result.seeders not in (-1, None) and result.leechers not in (-1, None)107 if app.SEEDERS_LEECHERS_IN_NOTIFY and has_peers:108 message = u'{0} with {1} seeders and {2} leechers from {3}'.format(109 ep_name, result.seeders, result.leechers, result.provider.name)110 else:111 message = u'{0} from {1}'.format(ep_name, result.provider.name)112 for n in notifiers:113 try:114 n.notify_snatch(title, message)115 except (RequestException, socket.gaierror, socket.timeout) as error:116 log.debug(u'Unable to send snatch notification. Error: {0!r}', error)117def notify_git_update(new_version=''):118 for n in notifiers:119 if app.NOTIFY_ON_UPDATE:120 try:121 n.notify_git_update(new_version)122 except (RequestException, socket.gaierror, socket.timeout) as error:123 log.debug(u'Unable to send new update notification. Error: {0!r}', error)124def notify_login(ipaddress):125 for n in notifiers:126 if app.NOTIFY_ON_LOGIN:127 try:128 n.notify_login(ipaddress)129 except (RequestException, socket.gaierror, socket.timeout) as error:...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Slash automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful