{% extends "pagetemplate.j2.html" %} {% block title %}Event: {{ split_escape(name,'/','\\')[-1] | escape }}{% endblock %} {% block body %}

Event {{ split_escape(name,'/','\\')[-1] | escape }} of module {{ module| escape }} {{ "(stopped)" if (disabled) else "" }}

{% if not (module,name) in EventReferences %} Event not active, An error prevented this event from loading. {% endif %} {% if version == '__draft__' %}

This is an unsaved recovered draft version, that could not load because of errors. not the actual version that is loaded on the server. Please correct any errors and try saving again, or go to the working copy and save that to delete this draft.

{% endif %}
(Loaded in {{ timetaken}} s)

Basic

Setup Code

Enter python code. It will execute in the event global scope when it loads. If there is any problem, the other events will load then this will be retried. This is also how dependancies are reoslved. You will need to use the global keyword in the event action to overwrite a variable defined here. {% if not can_edit %}
You will not be able to save any change made as you are either not logged in or do not have permissions. {% endif %}

Trigger (Currently {{ prevstate| escape }})

Enter the trigger here. The trigger may either be a python expression. Only one copy of each event will poll at a time. (by default, event runs when trigger goes from false to true), or a special trigger expression
{% if event['trigger'].startswith("!time") %}

Next Run for "{{ event['trigger'][5:]| escape }}": {{ formatnextrun() | escape }}

{% endif %}

Additional Trigger Options

Do the action repeatedly while the trigger is true
Do the action at most every: seconds. Does not affect poll rate(To avoid missing short events).
Polling Priority(to reduce CPU usage, use the lowest possible rate):

Action

This code will be executed when the trigger condition is met. Polling will be suspended until the action completes. NOTE: The Action is scoped like a function body. If you want to assign to variables and have them stay around next time the function runs, you may need to use the global keyword. You may also need to use the global keyword if you get UnboundLocal errors.
{% if (module,name) in EventReferences %}

Output

{{ EventReferences[module,name].logWindow.render() }}

Info

This event last ran: {% if getEventLastRan(module,name) %} {{ strftime(getEventLastRan(module,name))| escape }} (about {{ (format_time_interval(time.time()-getEventLastRan(module,name),2)) }} ago) {% if c %}
Average Time(Last {{ c }} runs): {{ (format_time_interval(avg_time,2)) }}
{% endif %} {% if EventReferences[module,name].lastcompleted>EventReferences[module,name].lastexecuted %}
Completed in {{ round(EventReferences[module,name].lastcompleted-EventReferences[module,name].lastexecuted,3)| escape }}s {% else %} Still Running {% endif %} {% else %} This event has not ran since it loaded. {% endif %}

{% if getEventErrors(module,name) %}

Errors[{{ len(getEventErrors(module,name)) }}]

This section the most recent errors that ocurred while executing the event or trigger.

{% for i in getEventErrors(module,name) %}

{{ i[0]| escape }}

{{ i[1]| escape }}
{% endfor %}
{% endif %} {% endif %}
Saving this module will case it to completely reload, including its local scope. Other resources will not be affected.
{% if can_edit %} {% else %}

You must have the "system_admin" permission to make changes. Are you logged in?

{% endif %}
{% endblock %}