gecko-dev/taskcluster/actions/hello-action.py
Jonas Finnemann Jensen 24c8b38973 Bug 1332506 - Treeherder actions defined in-tree. r=dustin
Framework for defining actions in-tree that can be displayed
and triggered from Treeherder.

MozReview-Commit-ID: 3rvwgy2i4xu

--HG--
extra : rebase_source : beca394f4337aae4ab149e4db810352f57ec4988
2017-01-31 15:34:05 -08:00

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"