Mercurial > libervia-backend
annotate src/core/constants.py @ 926:d609581bf74a
plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
- registerTextCommands can be called by a plugin in its __init__ method, it looks for methods starting with "cmd_" and register them as new commands
- addWhoIsCb: add a callback to /whois command, the callback can complete whois informations
- plugins parrot, XEP-0045 and XEP-0092 now manage their own commands
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 24 Mar 2014 10:57:15 +0100 |
parents | e77948faaef3 |
children | cbf4122baae7 |
rev | line source |
---|---|
914
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 #!/usr/bin/python |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 # SàT: a XMPP client |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Jérôme Poisson (goffi@goffi.org) |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 # it under the terms of the GNU Affero General Public License as published by |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 # (at your option) any later version. |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 # GNU Affero General Public License for more details. |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
20 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 class Const(object): |
923 | 22 APP_NAME = u'Salut à Toi' |
23 APP_NAME_SHORT = u'SàT' | |
24 APP_NAME_FULL = u'%s (%s)' % (APP_NAME_SHORT, APP_NAME) | |
25 APP_VERSION = u'0.4.1D' # Please add 'D' at the end for dev versions | |
26 | |
27 DEFAULT_CONFIG = { | |
28 'local_dir': '~/.sat', | |
29 'media_dir': '/usr/share/sat/media', | |
30 } | |
31 | |
914
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
32 NO_SECURITY_LIMIT = -1 |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
33 INDIVIDUAL = "individual" |
1a3ba959f0ab
core (memory): moved Params in its own module + introduced a new core/constants module, and moved some constants there
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
34 GENERAL = "general" |
923 | 35 SAVEFILE_DATABASE = "sat.db" |
916
1a759096ccbd
core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
Goffi <goffi@goffi.org>
parents:
914
diff
changeset
|
36 PROF_KEY_NONE = '@NONE@' |
1a759096ccbd
core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
Goffi <goffi@goffi.org>
parents:
914
diff
changeset
|
37 PROF_KEY_DEFAULT = '@DEFAULT@' |
919
ed9841e6d84a
core: added IQ_SET to core.constants + getLastResource now manage correctly jid.JID
Goffi <goffi@goffi.org>
parents:
916
diff
changeset
|
38 IQ_SET = '/iq[@type="set"]' |
926
d609581bf74a
plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents:
923
diff
changeset
|
39 |
d609581bf74a
plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents:
923
diff
changeset
|
40 # names of widely used plugins |
d609581bf74a
plugin text commands: refactoring, text now only contain main commands, and other plugin can add commands themselve:
Goffi <goffi@goffi.org>
parents:
923
diff
changeset
|
41 TEXT_CMDS = 'TEXT-COMMANDS' |