mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
24c8b38973
Framework for defining actions in-tree that can be displayed and triggered from Treeherder. MozReview-Commit-ID: 3rvwgy2i4xu --HG-- extra : rebase_source : beca394f4337aae4ab149e4db810352f57ec4988
31 lines
970 B
Python
31 lines
970 B
Python
from .registry import register_callback_action
|
|
|
|
|
|
@register_callback_action(
|
|
title='Say Hello',
|
|
symbol='hw',
|
|
description="""
|
|
Simple **proof-of-concept** action that prints a hello action.
|
|
""",
|
|
order=10000, # Put this at the very bottom/end of any menu (default)
|
|
context=[{}], # Applies to any task
|
|
available=lambda parameters: True, # available regardless decision parameters (default)
|
|
schema={
|
|
'type': 'string',
|
|
'maxLength': 255,
|
|
'default': 'World',
|
|
'title': 'Target Name',
|
|
'description': """
|
|
A name wish to say hello to...
|
|
This should normally be **your name**.
|
|
|
|
But you can also use the default value `'World'`.
|
|
""".strip(),
|
|
},
|
|
)
|
|
def hello_world_action(parameters, input, task_group_id, task_id, task):
|
|
print "This message was triggered from context-menu of taskId: {}".format(task_id)
|
|
print ""
|
|
print "Hello {}".format(input)
|
|
print "--- Action is now executed"
|