comparison src/core/constants.py @ 1171:0abce7f17782

core: a new "info" type is used in newMessage for system messages (not comming from outside)
author Goffi <goffi@goffi.org>
date Fri, 05 Sep 2014 19:29:30 +0200
parents 3164b509bc99
children a090e5ee83c2
comparison
equal deleted inserted replaced
1170:2df6427a5299 1171:0abce7f17782
55 STATIC_BLOG_PARAM_TITLE = "Title" 55 STATIC_BLOG_PARAM_TITLE = "Title"
56 STATIC_BLOG_PARAM_BANNER = "Banner" 56 STATIC_BLOG_PARAM_BANNER = "Banner"
57 STATIC_BLOG_PARAM_KEYWORDS = "Keywords" 57 STATIC_BLOG_PARAM_KEYWORDS = "Keywords"
58 STATIC_BLOG_PARAM_DESCRIPTION = "Description" 58 STATIC_BLOG_PARAM_DESCRIPTION = "Description"
59 59
60
60 ## Menus ## 61 ## Menus ##
61
62 MENU_GLOBAL = "GLOBAL" 62 MENU_GLOBAL = "GLOBAL"
63 MENU_ROOM = "ROOM" 63 MENU_ROOM = "ROOM"
64 MENU_SINGLE = "SINGLE" 64 MENU_SINGLE = "SINGLE"
65 MENU_JID_CONTEXT = "JID_CONTEXT" 65 MENU_JID_CONTEXT = "JID_CONTEXT"
66 MENU_ROSTER_JID_CONTEXT = "ROSTER_JID_CONTEXT" 66 MENU_ROSTER_JID_CONTEXT = "ROSTER_JID_CONTEXT"
67 MENU_ROSTER_GROUP_CONTEXT = "MENU_ROSTER_GROUP_CONTEXT" 67 MENU_ROSTER_GROUP_CONTEXT = "MENU_ROSTER_GROUP_CONTEXT"
68
68 69
69 ## Profile and entities ## 70 ## Profile and entities ##
70 PROF_KEY_NONE = '@NONE@' 71 PROF_KEY_NONE = '@NONE@'
71 PROF_KEY_DEFAULT = '@DEFAULT@' 72 PROF_KEY_DEFAULT = '@DEFAULT@'
72 ENTITY_ALL = '@ALL@' 73 ENTITY_ALL = '@ALL@'
73 ENTITY_LAST_RESOURCE = 'LAST_RESOURCE' 74 ENTITY_LAST_RESOURCE = 'LAST_RESOURCE'
74 ENTITY_CAP_HASH = 'CAP_HASH' 75 ENTITY_CAP_HASH = 'CAP_HASH'
75 76
77
78 ## Messages ##
79 MESS_TYPE_INFO = 'info'
76 80
77 ## Configuration ## 81 ## Configuration ##
78 if BaseDirectory: # skipped when xdg module is not available (should not happen in backend) 82 if BaseDirectory: # skipped when xdg module is not available (should not happen in backend)
79 83
80 ## Configuration ## 84 ## Configuration ##
186 # XXX: we use a classmethod so we can use Const inheritance to change default options 190 # XXX: we use a classmethod so we can use Const inheritance to change default options
187 return(cls.LOG_OPT_COLORS, cls.LOG_OPT_LEVEL, cls.LOG_OPT_FORMAT, cls.LOG_OPT_LOGGER, cls.LOG_OPT_OUTPUT) 191 return(cls.LOG_OPT_COLORS, cls.LOG_OPT_LEVEL, cls.LOG_OPT_FORMAT, cls.LOG_OPT_LOGGER, cls.LOG_OPT_OUTPUT)
188 192
189 @classmethod 193 @classmethod
190 def bool(cls, value): 194 def bool(cls, value):
195 """retour str text value for bool, or bool value for str"""
191 if isinstance(value, bool): 196 if isinstance(value, bool):
192 return cls.BOOL_TRUE if value else cls.BOOL_FALSE 197 return cls.BOOL_TRUE if value else cls.BOOL_FALSE
193 return value.lower() == cls.BOOL_TRUE 198 return value.lower() == cls.BOOL_TRUE