8bddd2c919f5165cd7a1b05fc78324bbda6e4ecf
[leap_pycommon.git] / src / leap / common / events / catalog.py
1 # -*- coding: utf-8 -*-
2 # catalog.py
3 # Copyright (C) 2015 LEAP
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful",
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18
19 """
20 Events catalog.
21 """
22
23
24 EVENTS = [
25     "CLIENT_SESSION_ID",
26     "CLIENT_UID",
27     "IMAP_CLIENT_LOGIN",
28     "IMAP_SERVICE_FAILED_TO_START",
29     "IMAP_SERVICE_STARTED",
30     "IMAP_UNHANDLED_ERROR",
31     "KEYMANAGER_DONE_UPLOADING_KEYS",
32     "KEYMANAGER_FINISHED_KEY_GENERATION",
33     "KEYMANAGER_KEY_FOUND",
34     "KEYMANAGER_KEY_NOT_FOUND",
35     "KEYMANAGER_LOOKING_FOR_KEY",
36     "KEYMANAGER_STARTED_KEY_GENERATION",
37     "MAIL_FETCHED_INCOMING",
38     "MAIL_MSG_DECRYPTED",
39     "MAIL_MSG_DELETED_INCOMING",
40     "MAIL_MSG_PROCESSING",
41     "MAIL_MSG_SAVED_LOCALLY",
42     "MAIL_UNREAD_MESSAGES",
43     "RAISE_WINDOW",
44     "SMTP_CONNECTION_LOST",
45     "SMTP_END_ENCRYPT_AND_SIGN",
46     "SMTP_END_SIGN",
47     "SMTP_RECIPIENT_ACCEPTED_ENCRYPTED",
48     "SMTP_RECIPIENT_ACCEPTED_UNENCRYPTED",
49     "SMTP_RECIPIENT_REJECTED",
50     "SMTP_SEND_MESSAGE_ERROR",
51     "SMTP_SEND_MESSAGE_START",
52     "SMTP_SEND_MESSAGE_SUCCESS",
53     "SMTP_SERVICE_FAILED_TO_START",
54     "SMTP_SERVICE_STARTED",
55     "SMTP_START_ENCRYPT_AND_SIGN",
56     "SMTP_START_SIGN",
57     "SOLEDAD_CREATING_KEYS",
58     "SOLEDAD_DONE_CREATING_KEYS",
59     "SOLEDAD_DONE_DATA_SYNC",
60     "SOLEDAD_DONE_DOWNLOADING_KEYS",
61     "SOLEDAD_DONE_UPLOADING_KEYS",
62     "SOLEDAD_DOWNLOADING_KEYS",
63     "SOLEDAD_INVALID_AUTH_TOKEN",
64     "SOLEDAD_NEW_DATA_TO_SYNC",
65     "SOLEDAD_SYNC_RECEIVE_STATUS",
66     "SOLEDAD_SYNC_SEND_STATUS",
67     "SOLEDAD_UPLOADING_KEYS",
68     "UPDATER_DONE_UPDATING",
69     "UPDATER_NEW_UPDATES",
70 ]
71
72
73 class Event(object):
74
75     def __init__(self, label):
76         self.label = label
77
78     def __repr__(self):
79         return '<Event: %s>' % self.label
80
81     def __str__(self):
82         return self.label
83
84
85 # create local variables based on the event list above
86 lcl = locals()
87 for event in EVENTS:
88     lcl[event] = Event(event)