Can't set custom actions. Only parsable from URL
194741
public static function registerCustomRouteClass(string $routeKey, string $routeClass) {
        self::checkRegisterAvailability();
        if (!class_exists($routeClass))
            throw new AppLogicException('Class '.$routeClass.' does not exist');
        self::$customRouteClasses[$routeKey] = $routeClass;
    }
1084683
def setup_common_actions(self):
        """"""
        # Filters
        filters_action = create_action(self, _("Edit filename filters..."),
                                       None, ima.icon('filter'),
                                       triggered=self.edit_filter)
        # Show all files
        all_action = create_action(self, _("Show all files"),
                                   toggled=self.toggle_all)
        all_action.setChecked(self.show_all)
        self.toggle_all(self.show_all)

        # Show all files
        single_click_to_open = create_action(
            self,
            _("Single click to open"),
            toggled=self.set_single_click_to_open,
        )
        single_click_to_open.setChecked(self.single_click_to_open)
        return [filters_action, all_action, single_click_to_open]
329489
def setup_option_actions(self, exclude_private, exclude_uppercase,
                             exclude_capitalized, exclude_unsupported):
        """"""
        self.setup_in_progress = True

        self.exclude_private_action = create_action(self,
                _("Exclude private references"),
                tip=_("Exclude references which name starts"
                            " with an underscore"),
                toggled=lambda state:
                self.sig_option_changed.emit('exclude_private', state))
        self.exclude_private_action.setChecked(exclude_private)
        
        self.exclude_uppercase_action = create_action(self,
                _("Exclude all-uppercase references"),
                tip=_("Exclude references which name is uppercase"),
                toggled=lambda state:
                self.sig_option_changed.emit('exclude_uppercase', state))
        self.exclude_uppercase_action.setChecked(exclude_uppercase)
        
        self.exclude_capitalized_action = create_action(self,
                _("Exclude capitalized references"),
                tip=_("Exclude references which name starts with an "
                      "uppercase character"),
                toggled=lambda state:
                self.sig_option_changed.emit('exclude_capitalized', state))
        self.exclude_capitalized_action.setChecked(exclude_capitalized)
        
        self.exclude_unsupported_action = create_action(self,
                _("Exclude unsupported data types"),
                tip=_("Exclude references to unsupported data types"
                            " (i.e. which won't be handled/saved correctly)"),
                toggled=lambda state:
                self.sig_option_changed.emit('exclude_unsupported', state))
        self.exclude_unsupported_action.setChecked(exclude_unsupported)

        self.actions = [
            self.exclude_private_action, self.exclude_uppercase_action,
            self.exclude_capitalized_action, self.exclude_unsupported_action]
        if is_module_installed('numpy'):
            self.actions.extend([MENU_SEPARATOR, self.editor.minmax_action])

        self.setup_in_progress = False
137259
def action(context, request, action=None, resource=None, uid=None):
    

    # allow to set the method via the header
    if action is None:
        action = request.get_header("HTTP_X_HTTP_METHOD_OVERRIDE", "CREATE").lower()

    # Fetch and call the action function of the API
    func_name = "{}_items".format(action)
    action_func = getattr(api, func_name, None)
    if action_func is None:
        api.fail(500, "API has no member named '{}'".format(func_name))

    portal_type = api.resource_to_portal_type(resource)
    items = action_func(portal_type=portal_type, uid=uid)

    return {
        "count": len(items),
        "items": items,
        "url": api.url_for("senaite.jsonapi.v1.action", action=action),
    }
472509
def url_for(action, params={})
      params[:api_key] = api_key
      url = URI.join(base_url, "/#{version}/", action)
      url.query = URI.encode_www_form(params)
      url.to_s
    end
889469
def _init_actions(self, create_standard_actions):
        
        menu_advanced = QtWidgets.QMenu(_('Advanced'))
        self.add_menu(menu_advanced)
        self._sub_menus = {
            'Advanced': menu_advanced
        }
        if create_standard_actions:
            # Undo
            action = QtWidgets.QAction(_('Undo'), self)
            action.setShortcut('Ctrl+Z')
            action.setIcon(icons.icon(
                'edit-undo', ':/pyqode-icons/rc/edit-undo.png', 'fa.undo'))
            action.triggered.connect(self.undo)
            self.undoAvailable.connect(action.setVisible)
            action.setVisible(False)
            self.add_action(action, sub_menu=None)
            self.action_undo = action
            # Redo
            action = QtWidgets.QAction(_('Redo'), self)
            action.setShortcut('Ctrl+Y')
            action.setIcon(icons.icon(
                'edit-redo', ':/pyqode-icons/rc/edit-redo.png', 'fa.repeat'))
            action.triggered.connect(self.redo)
            self.redoAvailable.connect(action.setVisible)
            action.setVisible(False)
            self.add_action(action, sub_menu=None)
            self.action_redo = action
            # Copy
            action = QtWidgets.QAction(_('Copy'), self)
            action.setShortcut(QtGui.QKeySequence.Copy)
            action.setIcon(icons.icon(
                'edit-copy', ':/pyqode-icons/rc/edit-copy.png', 'fa.copy'))
            action.triggered.connect(self.copy)
            self.add_action(action, sub_menu=None)
            self.action_copy = action
            # cut
            action = QtWidgets.QAction(_('Cut'), self)
            action.setShortcut(QtGui.QKeySequence.Cut)
            action.setIcon(icons.icon(
                'edit-cut', ':/pyqode-icons/rc/edit-cut.png', 'fa.cut'))
            action.triggered.connect(self.cut)
            self.add_action(action, sub_menu=None)
            self.action_cut = action
            # paste
            action = QtWidgets.QAction(_('Paste'), self)
            action.setShortcut(QtGui.QKeySequence.Paste)
            action.setIcon(icons.icon(
                'edit-paste', ':/pyqode-icons/rc/edit-paste.png',
                'fa.paste'))
            action.triggered.connect(self.paste)
            self.add_action(action, sub_menu=None)
            self.action_paste = action
        # duplicate line
        action = QtWidgets.QAction(_('Duplicate line'), self)
        action.setShortcut('Ctrl+D')
        action.triggered.connect(self.duplicate_line)
        self.add_action(action, sub_menu=None)
        self.action_duplicate_line = action
        # swap line up
        action = QtWidgets.QAction(_('Swap line up'), self)
        action.setShortcut("Alt++")
        action.triggered.connect(self.swapLineUp)
        self.add_action(action, sub_menu=None)
        self.action_swap_line_up = action
        # swap line down
        action = QtWidgets.QAction(_('Swap line down'), self)
        action.setShortcut("Alt+-")
        action.triggered.connect(self.swapLineDown)
        self.add_action(action, sub_menu=None)
        self.action_swap_line_down = action
        # select all
        action = QtWidgets.QAction(_('Select all'), self)
        action.setShortcut(QtGui.QKeySequence.SelectAll)
        action.triggered.connect(self.selectAll)
        self.action_select_all = action
        self.add_action(self.action_select_all, sub_menu=None)
        self.add_separator(sub_menu=None)
        if create_standard_actions:
            # indent
            action = QtWidgets.QAction(_('Indent'), self)
            action.setShortcut('Tab')
            action.setIcon(icons.icon(
                'format-indent-more',
                ':/pyqode-icons/rc/format-indent-more.png', 'fa.indent'))
            action.triggered.connect(self.indent)
            self.add_action(action)
            self.action_indent = action
            # unindent
            action = QtWidgets.QAction(_('Un-indent'), self)
            action.setShortcut('Shift+Tab')
            action.setIcon(icons.icon(
                'format-indent-less',
                ':/pyqode-icons/rc/format-indent-less.png', 'fa.dedent'))
            action.triggered.connect(self.un_indent)
            self.add_action(action)
            self.action_un_indent = action
            self.add_separator()
        # goto
        action = QtWidgets.QAction(_('Go to line'), self)
        action.setShortcut('Ctrl+G')
        action.setIcon(icons.icon(
            'go-jump', ':/pyqode-icons/rc/goto-line.png', 'fa.share'))
        action.triggered.connect(self.goto_line)
        self.add_action(action)
        self.action_goto_line = action
719065
function CallTextAction(props) {
    var state = props.state, actions = props.actions, event = props.event, args = props.args, error = props.error;
    return (h("div", { class: "call-text-action" },
        error ? h("div", { class: "call-text-error" }, error) : h("div", null),
        h("button", { onclick: function () {
                actions.execute({
                    type: event.type,
                    name: event.name,
                    runId: state.selectedEvent.runId,
                    args: args
                });
            }, disabled: !!error }, "Execute")));
}
1123750
def manage_action(self,
                      stat_name,
                      trigger,
                      header,
                      action_key):
        """"""
        # Here is a command line for the current trigger ?
        try:
            command, repeat = self.get_limit_action(trigger, stat_name=stat_name)
        except KeyError:
            # Reset the trigger
            self.actions.set(stat_name, trigger)
        else:
            # Define the action key for the stats dict
            # If not define, then it sets to header
            if action_key is None:
                action_key = header

            # A command line is available for the current alert
            # 1) Build the {{mustache}} dictionnary
            if isinstance(self.get_stats_action(), list):
                # If the stats are stored in a list of dict (fs plugin for exemple)
                # Return the dict for the current header
                mustache_dict = {}
                for item in self.get_stats_action():
                    if item[self.get_key()] == action_key:
                        mustache_dict = item
                        break
            else:
                # Use the stats dict
                mustache_dict = self.get_stats_action()
            # 2) Run the action
            self.actions.run(
                stat_name, trigger,
                command, repeat, mustache_dict=mustache_dict)
1041960
public void setAction(String action) {
        try {
            this.action = new URI(action);
        } catch (URISyntaxException e) {
            throw new CitrusRuntimeException("Invalid action uri", e);
        }
    }
76234
def allow(cls, action, **kwargs):
        
        return cls.create(action, exclude=False, **kwargs)
464669
function handleCustomHTTPActions( $http, $attributeDataBaseName,
                                      $customActionAttributeArray, $customActionParameters )
    {
        $dataType = $this->dataType();
        if ( $dataType )
        {
            $customActionParameters['contentobject_attribute'] = $this;
            $dataType->handleCustomObjectHTTPActions( $http, $attributeDataBaseName,
                                                      $customActionAttributeArray, $customActionParameters );
        }
    }
516758
def hook_for(self, configurable_class, action):
        
        configurable_class_name = configurable_class.__name__.lower()

        return getattr(
            self,
            "on_" + configurable_class_name + "_" + action,
            None
        )
1325154
function setAction( $value, $params=FALSE ) {
    $this->action['value']  = $value;
    $this->action['params'] = $this->_setParams( $params );
  }
100575
public void setAction(final Action action) {
		MenuItemModel model = getOrCreateComponentModel();
		model.action = action;
		model.url = null;
	}
1003853
def register_action(*args, **kwarg):
    '''
    
    '''
    def decorator(fun):
        KeywordArgumentParser._action_dict[frozenset(args)] = fun
        return fun
    return decorator
285386
public void setAction(String action)
    {
        ExtendedInfo info = getInfo(action);
        if (info != null)
            info._action = action;
    }
752431
function invokeAction(requestData, callback) {
		var self = this;
		var endpointInfo = {
			host: invokeAction.host,
			sslHost: invokeAction.sslHost || sslHost,
			port: invokeAction.port,
			prefix: invokeAction.prefix,
			authtype: authType,
			url: helpers.formatPath(invokeAction.prefix, this.resourceName,
				action)
		};
		var credentials = {
			consumerkey: this.consumerkey,
			consumersecret: this.consumersecret
		};

		if (_.isFunction(requestData)) {
			callback = requestData;
			requestData = {};
		}

		function checkAndParse(err, data, response) {
			if (err) {
				return callback(err);
			}

			return responseParser.parse(data, {
				format: self.format,
				logger: self.logger,
				url: endpointInfo.url,
				params: requestData,
				contentType: response.headers['content-type']
			}, getLocationForRedirectsAndCallback);
			function getLocationForRedirectsAndCallback(err, parsed) {
				if (err) {
					return callback(err);
				}

				if (response && response.headers['location']) {
					parsed.location = response.headers['location'];
				}

				return callback(null, parsed);
			}
		}

		_.defaults(requestData, this.defaultParams);

		if (httpMethod === 'GET') {
			// Add the default parameters to the request data
			return request.get(endpointInfo, requestData, this.headers,
				credentials, this.logger, checkAndParse);
		}

		if (httpMethod === 'POST' || httpMethod === 'PUT') {
			return request.postOrPut(httpMethod, endpointInfo, requestData,
				this.headers, credentials, this.logger, checkAndParse);
		}

		return callback(new Error('Unsupported HTTP verb: ' + httpMethod));
	}