genvid.toolbox.EventsTool¶
-
class
genvid.toolbox.
EventsTool
(**kwargs)¶ Bases:
genvid.toolbox.config.ConfigTool
Tool in charge of managing events configuration
-
MAP_REDUCES
= 'genvid/events/mapreduce/'¶ The key prefix for all map-reduce definitions.
-
add_events_commands
()¶ Add the events commands to the parser.
Run it from
add_commands()
to add the events commands to the parser.
-
get_map_reduce_items
()¶ Get all map-reduce definitions available.
-
load_map_reduce
(name, path)¶ Load a map-reduce from a file.
If the file ended with .hcl, it used the HCL format for map-reduce. Elsewhere, it consider it a JSON file.
-
map_reduce_hcl_to_json
(hcldef)¶ Transform the map object produce by map “<id>” {} hcl syntax to the expected { “maps” : [ { “id”: … ] } object of events.
-
print_map_reduce
()¶ Print on stdout the list of map-reduce configured.
-
run_events_command
(command, options)¶ Detect if the command is an events command and execute it.
Call it from
run_command()
to handle events commands. Events commands are added with the help ofadd_events_commands()
.Returns:
handled, result: A tuple with a boolean saying if the command were handled, and it’s result if that the case.
-
update_map_reduce
(name, mrdef)¶ Update a map-reduce definition.
-