comparison libervia/common/constants.py @ 1124:28e3eb3bb217

files reorganisation and installation rework: - files have been reorganised to follow other SàT projects and usual Python organisation (no more "/src" directory) - VERSION file is now used, as for other SàT projects - replace the overcomplicated setup.py be a more sane one. Pyjamas part is not compiled anymore by setup.py, it must be done separatly - removed check for data_dir if it's empty - installation tested working in virtual env - libervia launching script is now in bin/libervia
author Goffi <goffi@goffi.org>
date Sat, 25 Aug 2018 17:59:48 +0200
parents src/common/constants.py@f6319c27f2eb
children 2af117bfe6cc
comparison
equal deleted inserted replaced
1123:63a4b8fe9782 1124:28e3eb3bb217
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Libervia: 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_frontends.quick_frontend import constants
21 import os.path
22
23
24 class Const(constants.Const):
25
26 # XXX: we don't want to use the APP_VERSION inherited from sat.core.constants version
27 # as we use this version to check that there is not a mismatch with backend
28 APP_VERSION = u"0.7.0D" # Please add 'D' at the end for dev versions
29 LIBERVIA_MAIN_PAGE = "libervia.html"
30
31 # REGISTRATION
32 # XXX: for now libervia forces the creation to lower case
33 # XXX: Regex patterns must be compatible with both Python and JS
34 REG_LOGIN_RE = r"^[a-z0-9_-]+$"
35 REG_EMAIL_RE = r"^.+@.+\..+"
36 PASSWORD_MIN_LENGTH = 6
37
38 # HTTP REQUEST RESULT VALUES
39 PROFILE_AUTH_ERROR = "PROFILE AUTH ERROR"
40 XMPP_AUTH_ERROR = "XMPP AUTH ERROR"
41 ALREADY_WAITING = "ALREADY WAITING"
42 SESSION_ACTIVE = "SESSION ACTIVE"
43 NOT_CONNECTED = "NOT CONNECTED"
44 PROFILE_LOGGED = "LOGGED"
45 PROFILE_LOGGED_EXT_JID = "LOGGED (REGISTERED WITH EXTERNAL JID)"
46 ALREADY_EXISTS = "ALREADY EXISTS"
47 REGISTRATION_SUCCEED = "REGISTRATION"
48 INTERNAL_ERROR = "INTERNAL ERROR"
49 INVALID_INPUT = "INVALID INPUT"
50 BAD_REQUEST = "BAD REQUEST"
51 NO_REPLY = "NO REPLY"
52 NOT_ALLOWED = "NOT ALLOWED"
53 UPLOAD_OK = "UPLOAD OK"
54 UPLOAD_KO = "UPLOAD KO"
55
56 # directories
57 MEDIA_DIR = "media/"
58 CACHE_DIR = "cache"
59
60 # avatars
61 DEFAULT_AVATAR_FILE = "default_avatar.png"
62 DEFAULT_AVATAR_URL = os.path.join(MEDIA_DIR, "misc", DEFAULT_AVATAR_FILE)
63 EMPTY_AVATAR_FILE = "empty_avatar"
64 EMPTY_AVATAR_URL = os.path.join(MEDIA_DIR, "misc", EMPTY_AVATAR_FILE)
65
66 # blog
67 MAM_FILTER_CATEGORY = "http://salut-a-toi.org/protocols/mam_filter_category"