'Set skip sleep/abort event for all accounts.
If we want to skip a current (or the next) sleep, or if we want
to abort an autorefresh loop, the main thread can use
set_abort_event() to send the corresponding signal. Signum = 1
implies that we want all accounts to abort or skip the current
or next sleep phase. Signum = 2 will end the autorefresh loop,
ie all accounts will return after they finished a sync. signum=3
means, abort NOW, e.g. on SIGINT or SIGTERM.
This is a class method, it will send the signal to all accounts.'

@classmethod
def set_abort_event(cls, config, signum):

    if (signum == 1):
        for acctsection in getaccountlist(config):
            config.set(('Account    ' + acctsection), 'skipsleep', '1')
    elif (signum == 2):
        cls.abort_soon_signal.set()
    elif (signum == 3):
        cls.abort_NOW_signal.set()
