comparison sat_frontends/quick_frontend/constants.py @ 2624:56f94936df1e

code style reformatting using black
author Goffi <goffi@goffi.org>
date Wed, 27 Jun 2018 20:14:46 +0200
parents fe9888d3fcb6
children 003b8b4b56a7
comparison
equal deleted inserted replaced
2623:49533de4540b 2624:56f94936df1e
22 from collections import OrderedDict # only available from python 2.7 22 from collections import OrderedDict # only available from python 2.7
23 23
24 24
25 class Const(constants.Const): 25 class Const(constants.Const):
26 26
27 PRESENCE = OrderedDict([("", _("Online")), 27 PRESENCE = OrderedDict(
28 ("chat", _("Free for chat")), 28 [
29 ("away", _("Away from keyboard")), 29 ("", _("Online")),
30 ("dnd", _("Do not disturb")), 30 ("chat", _("Free for chat")),
31 ("xa", _("Extended away"))]) 31 ("away", _("Away from keyboard")),
32 ("dnd", _("Do not disturb")),
33 ("xa", _("Extended away")),
34 ]
35 )
32 36
33 # from plugin_misc_text_syntaxes 37 # from plugin_misc_text_syntaxes
34 SYNTAX_XHTML = "XHTML" 38 SYNTAX_XHTML = "XHTML"
35 SYNTAX_CURRENT = "@CURRENT@" 39 SYNTAX_CURRENT = "@CURRENT@"
36 SYNTAX_TEXT = "text" 40 SYNTAX_TEXT = "text"
40 SAT_PARAM_SEPARATOR = "_XMLUI_PARAM_" # used to have unique elements names 44 SAT_PARAM_SEPARATOR = "_XMLUI_PARAM_" # used to have unique elements names
41 XMLUI_STATUS_VALIDATED = "validated" 45 XMLUI_STATUS_VALIDATED = "validated"
42 XMLUI_STATUS_CANCELLED = constants.Const.XMLUI_DATA_CANCELLED 46 XMLUI_STATUS_CANCELLED = constants.Const.XMLUI_DATA_CANCELLED
43 47
44 # Roster 48 # Roster
45 CONTACT_GROUPS = 'groups' 49 CONTACT_GROUPS = "groups"
46 CONTACT_RESOURCES = 'resources' 50 CONTACT_RESOURCES = "resources"
47 CONTACT_MAIN_RESOURCE = 'main_resource' 51 CONTACT_MAIN_RESOURCE = "main_resource"
48 CONTACT_SPECIAL = 'special' 52 CONTACT_SPECIAL = "special"
49 CONTACT_SPECIAL_GROUP = 'group' # group chat special entity 53 CONTACT_SPECIAL_GROUP = "group" # group chat special entity
50 CONTACT_SELECTED = 'selected' 54 CONTACT_SELECTED = "selected"
51 # used in handler to track where the contact is coming from 55 # used in handler to track where the contact is coming from
52 CONTACT_PROFILE = 'profile' 56 CONTACT_PROFILE = "profile"
53 CONTACT_SPECIAL_ALLOWED = (CONTACT_SPECIAL_GROUP,) # allowed values for special flag 57 CONTACT_SPECIAL_ALLOWED = (CONTACT_SPECIAL_GROUP,) # allowed values for special flag
54 # set of forbidden names for contact data 58 # set of forbidden names for contact data
55 CONTACT_DATA_FORBIDDEN = {CONTACT_GROUPS, CONTACT_RESOURCES, CONTACT_MAIN_RESOURCE, 59 CONTACT_DATA_FORBIDDEN = {
56 CONTACT_SELECTED, CONTACT_PROFILE} 60 CONTACT_GROUPS,
61 CONTACT_RESOURCES,
62 CONTACT_MAIN_RESOURCE,
63 CONTACT_SELECTED,
64 CONTACT_PROFILE,
65 }
57 66
58 # Chats 67 # Chats
59 CHAT_STATE_ICON = { 68 CHAT_STATE_ICON = {
60 "": u" ", 69 "": u" ",
61 "active": u'✔', 70 "active": u"✔",
62 "inactive": u'☄', 71 "inactive": u"☄",
63 "gone": u'✈', 72 "gone": u"✈",
64 "composing": u'✎', 73 "composing": u"✎",
65 "paused": u"…" 74 "paused": u"…",
66 } 75 }
67 76
68 # Blogs 77 # Blogs
69 ENTRY_MODE_TEXT = "text" 78 ENTRY_MODE_TEXT = "text"
70 ENTRY_MODE_RICH = "rich" 79 ENTRY_MODE_RICH = "rich"
71 ENTRY_MODE_XHTML = "xhtml" 80 ENTRY_MODE_XHTML = "xhtml"
72 81
73 # Widgets management 82 # Widgets management
74 # FIXME: should be in quick_frontend.constant, but Libervia doesn't inherit from it 83 # FIXME: should be in quick_frontend.constant, but Libervia doesn't inherit from it
75 WIDGET_NEW = 'NEW' 84 WIDGET_NEW = "NEW"
76 WIDGET_KEEP = 'KEEP' 85 WIDGET_KEEP = "KEEP"
77 WIDGET_RAISE = 'RAISE' 86 WIDGET_RAISE = "RAISE"
78 WIDGET_RECREATE = 'RECREATE' 87 WIDGET_RECREATE = "RECREATE"
79 88
80 # Updates (generic) 89 # Updates (generic)
81 UPDATE_DELETE = 'DELETE' 90 UPDATE_DELETE = "DELETE"
82 UPDATE_MODIFY = 'MODIFY' 91 UPDATE_MODIFY = "MODIFY"
83 UPDATE_ADD = 'ADD' 92 UPDATE_ADD = "ADD"
84 UPDATE_SELECTION = 'SELECTION' 93 UPDATE_SELECTION = "SELECTION"
85 # high level update (i.e. not item level but organisation of items) 94 # high level update (i.e. not item level but organisation of items)
86 UPDATE_STRUCTURE = 'STRUCTURE' 95 UPDATE_STRUCTURE = "STRUCTURE"
87 96
88 LISTENERS = {'avatar', 'nick', 'presence', 'profilePlugged', 'disconnect', 'gotMenus', 97 LISTENERS = {
89 'menu', 'notification', 'notificationsClear', 'progressFinished', 98 "avatar",
90 'progressError'} 99 "nick",
100 "presence",
101 "profilePlugged",
102 "disconnect",
103 "gotMenus",
104 "menu",
105 "notification",
106 "notificationsClear",
107 "progressFinished",
108 "progressError",
109 }
91 110
92 # Notifications 111 # Notifications
93 NOTIFY_MESSAGE = 'MESSAGE' # a message has been received 112 NOTIFY_MESSAGE = "MESSAGE" # a message has been received
94 NOTIFY_MENTION = 'MENTION' # user has been mentionned 113 NOTIFY_MENTION = "MENTION" # user has been mentionned
95 NOTIFY_PROGRESS_END = 'PROGRESS_END' # a progression has finised 114 NOTIFY_PROGRESS_END = "PROGRESS_END" # a progression has finised
96 NOTIFY_GENERIC = 'GENERIC' # a notification which has not its own type 115 NOTIFY_GENERIC = "GENERIC" # a notification which has not its own type
97 NOTIFY_ALL = (NOTIFY_MESSAGE, NOTIFY_MENTION, NOTIFY_PROGRESS_END, NOTIFY_GENERIC) 116 NOTIFY_ALL = (NOTIFY_MESSAGE, NOTIFY_MENTION, NOTIFY_PROGRESS_END, NOTIFY_GENERIC)