Mercurial > libervia-web
annotate libervia/server/classes.py @ 1199:b300eaec53b6
server: don't raise error anymore if themes_dir is invalid or legacy blog can't be created:
legacy blog will be entirely removed with 0.8 release, and themes_dir is only used by it.
This patch limit troubles with this old code by not raising an error anymore if option is
wrong or if the legacy blog can't be created.
fix 317
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 09 Jul 2019 20:20:46 +0200 |
parents | 352865f4a268 |
children | 987595a254b0 |
rev | line source |
---|---|
1185
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 #!/usr/bin/python |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
4 # Libervia: a Salut à Toi frontend |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
5 # Copyright (C) 2011-2019 Jérôme Poisson <goffi@goffi.org> |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
8 # it under the terms of the GNU Affero General Public License as published by |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
10 # (at your option) any later version. |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
15 # GNU Affero General Public License for more details. |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
20 """Useful genertic classes used in Libervia""" |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
21 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
22 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
23 from collections import namedtuple |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
24 |
7d6c0e5d5f34
server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
25 WebsocketMeta = namedtuple("WebsocketMeta", ("url", "token", "debug")) |
1186
352865f4a268
server: added a generic way to have notification messages in pages
Goffi <goffi@goffi.org>
parents:
1185
diff
changeset
|
26 Notification = namedtuple("Notification", ("message", "level")) |