comparison sat_frontends/quick_frontend/constants.py @ 2562:26edcf3a30eb

core, setup: huge cleaning: - moved directories from src and frontends/src to sat and sat_frontends, which is the recommanded naming convention - move twisted directory to root - removed all hacks from setup.py, and added missing dependencies, it is now clean - use https URL for website in setup.py - removed "Environment :: X11 Applications :: GTK", as wix is deprecated and removed - renamed sat.sh to sat and fixed its installation - added python_requires to specify Python version needed - replaced glib2reactor which use deprecated code by gtk3reactor sat can now be installed directly from virtualenv without using --system-site-packages anymore \o/
author Goffi <goffi@goffi.org>
date Mon, 02 Apr 2018 19:44:50 +0200
parents frontends/src/quick_frontend/constants.py@0046283a285d
children fe9888d3fcb6
comparison
equal deleted inserted replaced
2561:bd30dc3ffe5a 2562:26edcf3a30eb
1 #!/usr/bin/env python2
2 # -*- coding: utf-8 -*-
3
4 # Primitivus: a SAT frontend
5 # Copyright (C) 2009-2018 Jérôme Poisson (goffi@goffi.org)
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 from sat.core import constants
21 from sat.core.i18n import _
22 from collections import OrderedDict # only available from python 2.7
23
24
25 class Const(constants.Const):
26
27 PRESENCE = OrderedDict([("", _("Online")),
28 ("chat", _("Free for chat")),
29 ("away", _("Away from keyboard")),
30 ("dnd", _("Do not disturb")),
31 ("xa", _("Extended away"))])
32
33 # from plugin_misc_text_syntaxes
34 SYNTAX_XHTML = "XHTML"
35 SYNTAX_CURRENT = "@CURRENT@"
36 SYNTAX_TEXT = "text"
37
38 # XMLUI
39 SAT_FORM_PREFIX = "SAT_FORM_"
40 SAT_PARAM_SEPARATOR = "_XMLUI_PARAM_" # used to have unique elements names
41 XMLUI_STATUS_VALIDATED = "validated"
42 XMLUI_STATUS_CANCELLED = constants.Const.XMLUI_DATA_CANCELLED
43
44 # Roster
45 CONTACT_GROUPS = 'groups'
46 CONTACT_RESOURCES = 'resources'
47 CONTACT_MAIN_RESOURCE = 'main_resource'
48 CONTACT_SPECIAL = 'special'
49 CONTACT_SPECIAL_GROUP = 'group' # group chat special entity
50 CONTACT_SELECTED = 'selected'
51 CONTACT_PROFILE = 'profile' # used in handler to track where the contact is coming from
52 CONTACT_SPECIAL_ALLOWED = (CONTACT_SPECIAL_GROUP,) # allowed values for special flag
53 CONTACT_DATA_FORBIDDEN = {CONTACT_GROUPS, CONTACT_RESOURCES, CONTACT_MAIN_RESOURCE, CONTACT_SELECTED, CONTACT_PROFILE} # set of forbidden names for contact data
54
55 # Chats
56 CHAT_STATE_ICON = {
57 "": u" ",
58 "active": u'✔',
59 "inactive": u'☄',
60 "gone": u'✈',
61 "composing": u'✎',
62 "paused": u"…"
63 }
64
65 # Blogs
66 ENTRY_MODE_TEXT = "text"
67 ENTRY_MODE_RICH = "rich"
68 ENTRY_MODE_XHTML = "xhtml"
69
70 # Widgets management
71 # FIXME: should be in quick_frontend.constant, but Libervia doesn't inherit from it
72 WIDGET_NEW = 'NEW'
73 WIDGET_KEEP = 'KEEP'
74 WIDGET_RAISE = 'RAISE'
75 WIDGET_RECREATE = 'RECREATE'
76
77 # Updates (generic)
78 UPDATE_DELETE = 'DELETE'
79 UPDATE_MODIFY = 'MODIFY'
80 UPDATE_ADD = 'ADD'
81 UPDATE_SELECTION = 'SELECTION'
82 UPDATE_STRUCTURE = 'STRUCTURE' # high level update (i.e. not item level but organisation of items)
83
84 LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus', 'menu', 'notification', 'notificationsClear', 'progressFinished', 'progressError'}
85
86 # Notifications
87 NOTIFY_MESSAGE = 'MESSAGE' # a message has been received
88 NOTIFY_MENTION = 'MENTION' # user has been mentionned
89 NOTIFY_PROGRESS_END = 'PROGRESS_END' # a progression has finised
90 NOTIFY_GENERIC = 'GENERIC' # a notification which has not its own type
91 NOTIFY_ALL = (NOTIFY_MESSAGE, NOTIFY_MENTION, NOTIFY_PROGRESS_END, NOTIFY_GENERIC)