Change utility for determining event or superevent

We now check whether the object ID is an event or not, rather
than whether it is a superevent or not.  This is because the
superevent prefixes will likely be changing in the near future,
but the event prefixes are pretty well fixed.
parent 41dc0cfa
......@@ -10,18 +10,17 @@ from subprocess import Popen, PIPE
if == 'posix':
import pwd
superevent_prefix_regex = re.compile(r'^({prefixes})\d+'.format(
EVENT_PREFIXES = ['G', 'E', 'H', 'M', 'T']
event_prefix_regex = re.compile(r'^({prefixes})\d+'.format(
# Decorator for class methods so that they work for events or superevents
def event_or_superevent(func):
def inner(self, object_id, *args, **kwargs):
is_superevent = False
if superevent_prefix_regex.match(object_id):
is_superevent = True
is_superevent = True
if event_prefix_regex.match(object_id):
is_superevent = False
return func(self, object_id, is_superevent=is_superevent, *args,
return inner
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment