Skip to content

Refactor Actions for 0.2.x #54

Description

@danbradham

Proposal

Implement a simplified Action class.

class Action(object):
    description = ''
    identifier = ''
    label = ''
    menu = ''
    icon = ''

    def is_available(self, ctx):
        '''Return True if the action is available in the given context.'''
        return True

    def parameters(self, ctx):
        '''Return a Cerberus Schema dict to validate arguments passed to `Action.run`.'''
        return True

    def run(self, *args, **kwargs):
        '''The Actions main execution method.'''

Motivation

Make it easier to add custom menu items and actions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

proposalNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions