annotate src/browser/sat_browser/constants.py @ 589:a5019e62c3e9 frontends_multi_profiles

browser side: big refactoring to base Libervia on QuickFrontend, first draft: /!\ not finished, partially working and highly instable - add collections module with an OrderedDict like class - SatWebFrontend inherit from QuickApp - general sat_frontends tools.jid module is used - bridge/json methods have moved to json module - UniBox is partially removed (should be totally removed before merge to trunk) - Signals are now register with the generic registerSignal method (which is called mainly in QuickFrontend) - the generic getOrCreateWidget method from QuickWidgetsManager is used instead of Libervia's specific methods - all Widget are now based more or less directly on QuickWidget - with the new QuickWidgetsManager.getWidgets method, it's no more necessary to check all widgets which are instance of a particular class - ChatPanel and related moved to chat module - MicroblogPanel and related moved to blog module - global and overcomplicated send method has been disabled: each class should manage its own sending - for consistency with other frontends, former ContactPanel has been renamed to ContactList and vice versa - for the same reason, ChatPanel has been renamed to Chat - for compatibility with QuickFrontend, a fake profile is used in several places, it is set to C.PROF_KEY_NONE (real profile is managed server side for obvious security reasons) - changed default url for web panel to SàT website, and contact address to generic SàT contact address - ContactList is based on QuickContactList, UI changes are done in update method - bride call (now json module) have been greatly improved, in particular call can be done in the same way as for other frontends (bridge.method_name(arg1, arg2, ..., callback=cb, errback=eb). Blocking method must be called like async methods due to javascript architecture - in bridge calls, a callback can now exists without errback - hard reload on BridgeSignals remote error has been disabled, a better option should be implemented - use of constants where that make sens, some style improvments - avatars are temporarily disabled - lot of code disabled, will be fixed or removed before merge - various other changes, check diff for more details server side: manage remote exception on getEntityData, removed getProfileJid call, added getWaitingConf, added getRoomsSubjects
author Goffi <goffi@goffi.org>
date Sat, 24 Jan 2015 01:45:39 +0100
parents ee9c7bd266ad
children 7af8f4ab3675
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
449
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
1 #!/usr/bin/python
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
3
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
4 # Libervia: a SAT frontend
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
5 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jérôme Poisson (goffi@goffi.org)
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
6
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
10 # (at your option) any later version.
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
11
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
16
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
19
462
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
20 from libervia.common.constants import Const as C
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
21
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
22
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
23 # Auxiliary functions
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
24 param_to_bool = lambda value: value == 'true'
449
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
25
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
26
462
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
27 class Const(C):
449
981ed669d3b3 /!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff changeset
28 """Add here the constants that are only used by the browser side."""
462
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
29
478
992b900ab876 browser side: rename and refactor constant UI_PARAMS to CACHED_PARAMS, from a dict of dict to a list of 2-tuple
souliane <souliane@mailoo.org>
parents: 477
diff changeset
30 # Cached parameters, e.g those that have an incidence on UI display/refresh:
462
07433bd892ee server and browser sides: fixes UI parameters initialisation with user values + small refactoring
souliane <souliane@mailoo.org>
parents: 449
diff changeset
31 # - they can be any parameter (not necessarily specific to Libervia)
478
992b900ab876 browser side: rename and refactor constant UI_PARAMS to CACHED_PARAMS, from a dict of dict to a list of 2-tuple
souliane <souliane@mailoo.org>
parents: 477
diff changeset
32 # - list them as a couple (category, name)
567
ee9c7bd266ad browser_side: implements "Show offline contacts" and "Show empty groups" parameters
souliane <souliane@mailoo.org>
parents: 483
diff changeset
33 CACHED_PARAMS = [(C.COMPOSITION_KEY, C.ENABLE_UNIBOX_PARAM),
ee9c7bd266ad browser_side: implements "Show offline contacts" and "Show empty groups" parameters
souliane <souliane@mailoo.org>
parents: 483
diff changeset
34 ('General', C.SHOW_OFFLINE_CONTACTS),
ee9c7bd266ad browser_side: implements "Show offline contacts" and "Show empty groups" parameters
souliane <souliane@mailoo.org>
parents: 483
diff changeset
35 ('General', C.SHOW_EMPTY_GROUPS),
ee9c7bd266ad browser_side: implements "Show offline contacts" and "Show empty groups" parameters
souliane <souliane@mailoo.org>
parents: 483
diff changeset
36 ]
477
fac8e8bc9a1a browser side: changed default avatar
souliane <souliane@mailoo.org>
parents: 467
diff changeset
37
483
0bbbef1d53a8 server side (blog): use user's avatar a the blog's favicon + small refactorization
souliane <souliane@mailoo.org>
parents: 479
diff changeset
38 # Empty avatar
479
c21ea1fe3593 browser side: small refactoring to prepare displaying avatars in the contact panel
souliane <souliane@mailoo.org>
parents: 478
diff changeset
39 EMPTY_AVATAR = "/media/misc/empty_avatar"
589
a5019e62c3e9 browser side: big refactoring to base Libervia on QuickFrontend, first draft:
Goffi <goffi@goffi.org>
parents: 567
diff changeset
40 WEB_PANEL_DEFAULT_URL = "http://salut-a-toi.org"