annotate cagou/__init__.py @ 247:cf61a011f731

core (notes), common (symbol): added an icon showing note level: because of Symbol binding, it was difficult to precisely set the icon position, so Symbol has been modified to remove bindings. Added consts for INFO, WARNING and ERROR colors.
author Goffi <goffi@goffi.org>
date Sat, 26 Jan 2019 20:24:48 +0100
parents ddfadedf2aed
children 1b835bcfa663
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
1 #!/usr//bin/env python2
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
2 # -*- coding: utf-8 -*-
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
3
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
4 # Cagou: desktop/mobile frontend for Salut à Toi XMPP client
126
cd99f70ea592 global file reorganisation:
Goffi <goffi@goffi.org>
parents: 16
diff changeset
5 # Copyright (C) 2016-2018 Jérôme Poisson (goffi@goffi.org)
15
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
6
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
7 # This program is free software: you can redistribute it and/or modify
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
10 # (at your option) any later version.
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
11
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
12 # This program is distributed in the hope that it will be useful,
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
15 # GNU Affero General Public License for more details.
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
16
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
19
162
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
20 import os.path
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
21
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
22
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
23 version_file = os.path.join(os.path.dirname(__file__), 'VERSION')
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
24 with open(version_file) as f:
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
25 __version__ = f.read().strip()
16
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
26
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
27 class Global(object):
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
28 @property
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
29 def host(self):
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
30 return self._host
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
31 G = Global()
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
32
162
ddfadedf2aed core: added __version__ variable
Goffi <goffi@goffi.org>
parents: 126
diff changeset
33 # this import must be done after G is created
15
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
34 from core import cagou_main
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
35
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
36 def run():
16
ba14b596b90e host can now be get as a global value:
Goffi <goffi@goffi.org>
parents: 15
diff changeset
37 host = G._host = cagou_main.Cagou()
15
56838ad5c84b files reorganisation, cagou is now launched with python2 cagou.py in src/
Goffi <goffi@goffi.org>
parents: 0
diff changeset
38 host.run()