Send announcement message.
427022
def announce
      apply_environment unless @approved

      mailopts = self.mailopts

      if mailto.empty?
        report "No recipents given."
      else
        if trial?
          subject = mailopts['subject']
          mailto  = mailopts['to'].flatten.join(", ")
          report "email '#{subject}' to #{mailto}"
        else
          #emailer = Emailer.new(mailopts)
          #emailer.email
          if @approved
            email(mailopts)
          else
            exit -1
          end
        end
      end
    end
488602
def message(msg, indent=False, mtype='standard', caption=False):
    """"""
    if caption:
        msg = '\n' + msg + '\n' + '-'*len(msg) + '\n'
    if mtype == 'warning':
        msg = colorlog('Warning:  ' + msg, 'yellow')
    if mtype == 'error':
        msg = colorlog('Error:  ' + msg, 'red')
    if mtype == 'debug':
        msg = colorlog('Debug:  ' + msg, 'pink')
    if mtype == 'info':
        msg = colorlog('Info:  ' + msg, 'green')
    if indent:
        msg = '  ' + msg
    sys.stderr.write(msg)
1223255
def _update_notification(self, message=None):
        """"""
        if message is None:
            message = ''
        message_label = self._parts['notification label']
        message_label.config(text=message)
        self._base.update()
963225
def notify(title, message, key, event=None, retcode=None):
    

    data = {
        'title': title if len(title) <= 20 else title[:19] + u'\u2026',
        'msg': message,
        'key': key
    }

    if event:
        data['event'] = event

    headers = {'User-Agent': USER_AGENT}

    endpoint = "https://api.simplepush.io"

    resp = requests.post(endpoint + '/send', data=data, headers=headers)

    resp.raise_for_status()
338373
def announced(self, state, announcement):
        '''
        
        '''
        state.problem = state.factory(state.agent, **announcement.payload)
        state.medium.bid(message.Bid())
1032814
def send_message(message, params, site, logger):
    """"""
    client.capture(
        'Message',
        message=message,
        params=tuple(params),
        data={
            'site': site,
            'logger': logger,
        },
    )
217686
def show_message(self, message, timeout=0):
        """"""
        self.main.statusBar().showMessage(message, timeout)
825772
def announce(self, number):
        
        self.client.publish(self.keys.internal, self.keys.key(number))
        self.message('{} granted'.format(number))
84100
function announce (server, service) {
  var delay = 1000
  var packet = service._records()

  server.register(packet)

  ;(function broadcast () {
    // abort if the service have or is being stopped in the meantime
    if (!service._activated || service._destroyed) return

    server.mdns.respond(packet, function () {
      // This function will optionally be called with an error object. We'll
      // just silently ignore it and retry as we normally would
      if (!service.published) {
        service._activated = true
        service.published = true
        service.emit('up')
      }
      delay = delay * REANNOUNCE_FACTOR
      if (delay < REANNOUNCE_MAX_MS && !service._destroyed) {
        setTimeout(broadcast, delay).unref()
      }
    })
  })()
}
872178
def notify(title, message, retcode=None):
    """"""
    if not path.exists(config_file):
        if not path.exists(config_dir):
            makedirs(config_dir)
        print("Follow the instructions to configure the Telegram backend.\n")
        configure(config_file)
    send(messages=[message], conf=config_file)
651269
private void deliverTempoChangedAnnouncement(final double tempo) {
        for (final MasterListener listener : getMasterListeners()) {
            try {
                listener.tempoChanged(tempo);
            } catch (Throwable t) {
                logger.warn("Problem delivering tempo changed announcement to listener", t);
            }
        }
    }
1097513
public function sendNews(){
        $news   = func_get_args();
        $openid = array_shift($news);
        return $this->messageCustomSend($openid, $news, self::MSG_TYPE_NEWS);
    }
50291
def set_welcome_message(self):
        """"""
        string = html_header()
        string += welcome_message().to_html()
        string += html_footer()
        self.welcome_message.setHtml(string)
829231
def new
      @announcement = Announcement.new
  
      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @announcement }
      end
    end
68074
def warn(self, message, *args, **kwargs):
        """"""
        self.log("warn", message, *args, **kwargs)
839882
def announcement_view(request, announcement_pk):
    '''  '''
    announce = get_object_or_404(Announcement, pk=announcement_pk)
    page_name = "View Announcement"
    profile = UserProfile.objects.get(user=request.user)
    pin_form = PinForm(
        request.POST if "pin" in request.POST else None,
        instance=announce,
        )
    can_edit = announce.incumbent == profile or request.user.is_superuser
    if pin_form.is_valid():
        pin_form.save()
        return HttpResponseRedirect(
            reverse('managers:view_announcement', kwargs={"announcement_pk": announcement_pk}),
            )
    return render_to_response('view_announcement.html', {
        'page_name': page_name,
        'pin_form': pin_form,
        'can_edit': can_edit,
        'announcement': announce,
        }, context_instance=RequestContext(request))
1233743
def __print(self, msg):
        """"""
        self.announce(msg, level=distutils.log.INFO)