Best Python code snippet using slash
jingle.gyp
Source: jingle.gyp
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 ],...
__init__.py
Source: __init__.py
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:...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!