annotate libervia/desktop/__init__.py @ 0:9754c1d6f4f4 draft default tip

Libervia Desktop initial commit
author Goffi <goffi@goffi.org>
date Fri, 12 Jul 2024 14:13:36 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python3
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
2
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Libervia Desktop-Kivy
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # Copyright (C) 2016-2021 Jérôme Poisson (goffi@goffi.org)
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
5
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # This program is free software: you can redistribute it and/or modify
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # it under the terms of the GNU Affero General Public License as published by
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # the Free Software Foundation, either version 3 of the License, or
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # (at your option) any later version.
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
10
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful,
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # GNU Affero General Public License for more details.
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
15
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
16 # You should have received a copy of the GNU Affero General Public License
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
18
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
19 import os.path
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
20
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
21
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
22 __version__ = "0.9.0.dev0"
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
23
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
24
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
25 class Global:
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
26
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
27 def __init__(self):
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
28 self._host: "main.LiberviaDesktopApp|None" = None
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
29
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
30 @property
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
31 def host(self):
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
32 return self._host
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
33
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
34
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
35 G = Global()
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
36
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
37 # this import must be done after G is created
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
38 from .core import main
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
39
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
40
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
41 def run():
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
42 host = G._host = main.LiberviaDesktopApp()
9754c1d6f4f4 Libervia Desktop initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
43 host.run()