Mercurial > libervia-web
annotate src/browser/sat_browser/constants.py @ 917:86563d6c83b0
server: Libervia pages:
- introduce new LiberviaPage which are easy to create web pages tailored for SàT architecture. They are expected to be the cornerstone of the future of Libervia.
- webpages paths reflected by files paths in src/pages directory (directory should be changeable in the future)
- if a pages subdirectory as a page_meta.py file, it is a webpage, same for sub-subdirectories and so on
- page_meta.py variable are used to instanciate the resource. Check __init__ docstring for details
- access is set with a page_meta.py variable (only public for now), and subdirectories access are restricted by parent directory ones.
- callables in page_meta.py get 2 arguments: the LiberviaPage resource instance, and the request
- callables there can use Deferred (or not)
- LiberviaPage has a couple of helper method to e.g. parse URL or return an error
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 05 Mar 2017 23:56:31 +0100 |
parents | f8a7a046ff9c |
children | fd4eae654182 |
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 |
818 | 5 # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org) |
449
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) |
696
c2f22ca12e23
browser and server side: remove unibox
souliane <souliane@mailoo.org>
parents:
685
diff
changeset
|
33 CACHED_PARAMS = [('General', C.SHOW_OFFLINE_CONTACTS), |
567
ee9c7bd266ad
browser_side: implements "Show offline contacts" and "Show empty groups" parameters
souliane <souliane@mailoo.org>
parents:
483
diff
changeset
|
34 ('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
|
35 ] |
477
fac8e8bc9a1a
browser side: changed default avatar
souliane <souliane@mailoo.org>
parents:
467
diff
changeset
|
36 |
589
a5019e62c3e9
browser side: big refactoring to base Libervia on QuickFrontend, first draft:
Goffi <goffi@goffi.org>
parents:
567
diff
changeset
|
37 WEB_PANEL_DEFAULT_URL = "http://salut-a-toi.org" |
612
5983d6be4f07
browser side (web panel): schemes are now checked, if no scheme is given (or a not accepted one), http:// is used
Goffi <goffi@goffi.org>
parents:
606
diff
changeset
|
38 WEB_PANEL_SCHEMES = {'http', 'https', 'ftp', 'file'} |
660
267761bf7f08
browser side (contact list): ContactPanels is used instead of OccupantsList in MUC:
Goffi <goffi@goffi.org>
parents:
612
diff
changeset
|
39 |
267761bf7f08
browser side (contact list): ContactPanels is used instead of OccupantsList in MUC:
Goffi <goffi@goffi.org>
parents:
612
diff
changeset
|
40 CONTACT_DEFAULT_DISPLAY=('bare', 'nick') |