Add action mentions
161735
def _link_to_action_mentions(self, actionmention_filename):
        """"""
        parser = GenewaysActionMentionParser(actionmention_filename)
        self.action_mentions = parser.action_mentions

        for action_mention in self.action_mentions:
            hiid = action_mention.hiid
            if hiid not in self.hiid_to_action_index:
                m1 = 'Parsed action mention has hiid %d, which does not exist'
                m2 = ' in table of action hiids'
                raise Exception((m1 + m2) % hiid)
            else:
                idx = self.hiid_to_action_index[hiid]
                self.actions[idx].action_mentions.append(action_mention)
1104675
def _add_pending_action(self, p_action, p_size):
        
        def generate_callback():
            def callback(*args):
                self.resolve_action(p_action, p_size)
                self.keystate = None

            return callback

        urwid.emit_signal(self, 'add_pending_action', generate_callback())
727225
def addAction(self, action):
        
        self.ACTIONS.append(action)
        return "ACTION#{}".format(len(self.ACTIONS) - 1)
1258162
def add_action(self, name, parent, action):
        
        if iskeyword(name):
            name = '_' + name
        self._actions[name] = parent.new_action(**action)
        setattr(self, name, self._actions[name].execute)
1064816
def __add_actions(self):
        

        LOGGER.debug("> Adding '{0}' Component actions.".format(self.__class__.__name__))

        add_project_action = self.__engine.actions_manager.get_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Add Project ...")
        remove_project_action = self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Remove Project",
            slot=self.__view_remove_project_action__triggered)
        self.__script_editor.file_menu.insertAction(add_project_action, remove_project_action)
        self.__script_editor.file_menu.removeAction(add_project_action)
        self.__script_editor.file_menu.insertAction(remove_project_action, add_project_action)
1196079
def add_action(name, altname=nil, &block)
      if @last_usage.nil?
        @last_usage = altname ? "(#{name}|#{altname})" : name 
      end
      [@namespace, @superspace].each do |prefix|
        prefix or next
        name = "#{prefix}_#{name}"
        @last_usage = "#{prefix} #{last_usage}" unless @last_usage == false
      end
      name = name.to_sym
      @actions[name] = Action.new(block, @last_usage, @last_help)
      @last_usage = nil
      @last_help = nil
      if altname 
        @last_usage = false
        add_action(altname, nil, &block)
      end
    end
689161
def addAction( self, action ):
        
        if not isinstance(action, QAction):
            action_name = nativestring(action)
            action = QAction(action_name, self)
            action.setObjectName(action_name)
        
        action.setCheckable(True)
        
        if ( not self._actionGroup ):
            self._actionGroup = QActionGroup(self)
            action.setChecked(True)
            
        self._actionGroup.addAction(action)
        self.reset()
        return action
1283633
public void addActionFrame(FbBotMillEvent event, AutoReply reply) {
		ActionFrame frame = new ActionFrame(event, reply);
		this.actionFrameList.add(frame);
	}
612065
def __add_actions(self):
        

        LOGGER.debug("> Adding '{0}' Component actions.".format(self.__class__.__name__))

        self.__script_editor.command_menu.addSeparator()
        self.__script_editor.command_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|addons.tcp_serverUi|&Command|Send Selection To Server",
            shortcut=Qt.ControlModifier + Qt.AltModifier + Qt.Key_Return,
            slot=self.__send_selection_to_server_action__triggered))
        self.__script_editor.command_menu.addAction(self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|addons.tcp_serverUi|&Command|&Send Current File To Server",
            shortcut=Qt.SHIFT + Qt.AltModifier + Qt.CTRL + Qt.Key_Return,
            slot=self.__send_file_to_server_action__triggered))
75044
public void addAction(Action act) {
        if (act.entry != null && act.entry != this) {
            Log.e(TAG, "addAction failed. Already applied to another notification - " +
                  act.entry.ID + ". Current notification is " + ID);
            return;
        }
        if (mActions == null) {
            mActions = new ArrayList<Action>();
        }
        if (mActions.size() == 3) {
            Log.w(TAG, "only suppport up to 3 actions.");
            return;
        }
        act.entry = this;
        mActions.add(act);
    }
687917
public function addToolbarCommands()
    {
        $actor = $this->getController()->getItem();
        $viewer = get_viewer();
        $this->_use_post = true;
        $this->addListCommands();

        if ($actor->authorize('administration')) {
            $this->addCommand('edit-actor', array('label' => AnTranslator::_('LIB-AN-ACTION-EDIT'), 'entity' => $actor))
            ->getCommand('edit-actor')
            ->href($actor->getURL().'&get=settings');
        }

        if (get_viewer()->admin()) {
            $action = ($actor->verified) ? 'unverify' : 'verify';
            $this->addCommand($action.'-actor', array('label' => AnTranslator::_('COM-ACTORS-PROFILE-'.$action), 'entity' => $actor))
            ->getCommand($action.'-actor')
            ->href($actor->getURL().'&action='.$action)
            ->dataTrigger('PostLink');
        }

        if ($actor->authorize('changeEnabled')) {
            $action = ($actor->enabled) ? 'disable' : 'enable';
            $this->addCommand($action.'-actor', array('label' => AnTranslator::_('LIB-AN-ACTION-'.$action), 'entity' => $actor))
            ->getCommand($action.'-actor')
            ->href($actor->getURL().'&action='.$action)
            ->dataTrigger('PostLink');
        }

        if ($actor->authorize('access') && !$viewer->eql($actor) && $viewer->following($actor)) {
            $this->addCommand('notifications-settings', array('label' => AnTranslator::_('COM-ACTORS-NOTIFICATIONS-SETTING-EDIT')))
            ->getCommand('notifications-settings')
            ->href(route('option=notifications&view=settings&layout=modal&oid='.$actor->id));
        }
    }
616323
def _add_action(self, notification, action, label, callback, *args):
        
        on_action_click = run_bg(lambda *_: callback(*args))
        try:
            # this is the correct signature for Notify-0.7, the last argument
            # being 'user_data':
            notification.add_action(action, label, on_action_click, None)
        except TypeError:
            # this is the signature for some older version, I don't know what
            # the last argument is for.
            notification.add_action(action, label, on_action_click, None, None)
        # gi.Notify does not store hard references to the notification
        # objects. When a signal is received and the notification does not
        # exist anymore, no handler will be called. Therefore, we need to
        # prevent these notifications from being destroyed by storing
        # references:
        notification.connect('closed', self._notifications.remove)
        self._notifications.append(notification)
1300584
def action(self, *action_names):
        """"""
        def action_wrapper(decorated):

            @functools.wraps(decorated)
            def wrapper(argv):
                kwargs = dict(arg.split('=') for arg in argv)
                try:
                    return decorated(**kwargs)
                except TypeError as e:
                    if decorated.__doc__:
                        e.args += (decorated.__doc__,)
                    raise

            self.register_action(decorated.__name__, wrapper)
            if '_' in decorated.__name__:
                self.register_action(
                    decorated.__name__.replace('_', '-'), wrapper)

            return wrapper

        return action_wrapper
46371
function mention(eat, value, silent) {
  var self = this
  var index
  var subvalue
  var handle
  var href
  var node
  var exit
  var now

  if (value.charCodeAt(0) !== CC_AT) {
    return
  }

  index = usernameEnd(value, 1)

  if (index === -1) {
    return
  }

  /* Support teams. */
  if (value.charCodeAt(index) === CC_SLASH) {
    index = usernameEnd(value, index + 1)

    if (index === -1) {
      return
    }
  }

  /* istanbul ignore if - maybe used by plug-ins */
  if (silent) {
    return true
  }

  now = eat.now()
  handle = value.slice(1, index)
  subvalue = C_AT + handle

  href = gh()
  href += own.call(OVERWRITES, handle) ? OVERWRITES[handle] : handle

  now.column++

  exit = self.enterLink()

  node = eat(subvalue)({
    type: 'link',
    title: null,
    url: href,
    children: self.tokenizeInline(subvalue, now)
  })

  exit()

  if (self.githubOptions.mentionStrong !== false) {
    node.children = [{type: 'strong', children: node.children}]
  }

  return node
}
53153
def add_to_sources(self, action, doc_source):
        """"""
        mapping = self.sources.setdefault(action["_index"], {}).setdefault(
            action["_type"], {}
        )
        mapping[action["_id"]] = doc_source
1091836
def register_actions(self, shortcut_manager):
        
        super(DescriptionEditorController, self).register_actions(shortcut_manager)
        shortcut_manager.add_callback_for_action("abort", self._abort)
42559
function _add_upgrade_action_link() {
            $this->_logger->entrance();

            if ( ! $this->is_paying() && $this->has_paid_plan() ) {
                $this->add_plugin_action_link(
                    $this->get_text_inline( 'Upgrade', 'upgrade' ),
                    $this->get_upgrade_url(),
                    false,
                    7,
                    'upgrade'
                );
            }

            if ( $this->has_addons() ) {
                $this->add_plugin_action_link(
                    $this->get_text_inline( 'Add-Ons', 'add-ons' ),
                    $this->_get_admin_page_url( 'addons' ),
                    false,
                    9,
                    'addons'
                );
            }
        }