Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(15)  |  Derive(0)  |  Import(0)
Return true if the section/key pair exists

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/twilio.py   serverherald(Download)
        # Twilio requires an Account SID, a token, a from, and a to phone
        # number
        if not self.config_has('twilio'):
            print ('`twilio` notification type requires a Twilio Account SID'
                   ', a token, a recipient and a sending phone number to be '
 
        for field, message in required_fields.iteritems():
            if not self.config_has('twilio', field):
                print message
                sys.exit(1)

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/nexmo.py   serverherald(Download)
        # Nexmo requires an API key, API secret, a from and a to phone
        # number
        if not self.config_has('nexmo'):
            print ('`nexmo` notification type requires a nexmo API key, API '
                   'secret, a recipient and a sending phone number to be '
 
        for field, message in required_fields.iteritems():
            if not self.config_has('nexmo', field):
                print message
                sys.exit(1)

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/prowl.py   serverherald(Download)
 
        # Prowl requires an API key
        if not self.config_has('prowl'):
            print ('`prowl` notification type requires a Prowl API key to be '
                   'specified in the config file.')
            sys.exit(1)
 
        if not self.config_has('prowl', 'apikey'):

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/webhook.py   serverherald(Download)
 
        # Webhook requires a URL
        if not self.config_has('webhook'):
            print ('`webhook` notification type requires a URL to be '
                   'specified in the config file.')
            sys.exit(1)
 
        if not self.config_has('webhook', 'url'):

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/pushover.py   serverherald(Download)
 
        # Pushover requires an API key
        if not self.config_has('pushover'):
            print ('`pushover` notification type requires a Pushover API '
                   'key to be specified in the config file.')
            sys.exit(1)
 
        if not self.config_has('pushover', 'apikey'):

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/pagerduty.py   serverherald(Download)
 
        # PagerDuty requires an API key
        if not self.config_has('pagerduty'):
            print ('`pagerduty` notification type requires a PagerDuty API '
                   'key to be specified in the config file.')
            sys.exit(1)
 
        if not self.config_has('pagerduty', 'apikey'):

src/s/e/serverherald-1-0.0.1/serverherald/notifiers/mail.py   serverherald(Download)
    def validate_config(self):
        """Email notifications require a `to` and `from` address"""
        ServerHeraldNotifyBase.validate_config(self)
 
        if not self.config_has('email') or not self.config_has('email', 'to'):
            print 'There are no recipient email addresses in the config file'
            sys.exit(1)
 
        if not self.config_has('email', 'from'):