| |
1 #!/usr/bin/env python3 |
| |
2 # |
| |
3 # Pidgin - Internet Messenger |
| |
4 # Copyright (C) Pidgin Developers <devel@pidgin.im> |
| |
5 # |
| |
6 # Pidgin is the legal property of its developers, whose names are too numerous |
| |
7 # to list here. Please refer to the COPYRIGHT file distributed with this |
| |
8 # source distribution. |
| |
9 # |
| |
10 # This program is free software; you can redistribute it and/or modify |
| |
11 # it under the terms of the GNU General Public License as published by |
| |
12 # the Free Software Foundation; either version 2 of the License, or |
| |
13 # (at your option) any later version. |
| |
14 # |
| |
15 # This program is distributed in the hope that it will be useful, |
| |
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
18 # GNU General Public License for more details. |
| |
19 # |
| |
20 # You should have received a copy of the GNU General Public License |
| |
21 # along with this library; if not, see <https://www.gnu.org/licenses/>. |
| |
22 |
| |
23 """ |
| |
24 This script will run the command specified via command line arguments, |
| |
25 making sure broadwayd is running and will be used. |
| |
26 """ |
| |
27 |
| |
28 import os |
| |
29 import subprocess |
| |
30 import sys |
| |
31 |
| |
32 |
| |
33 def main(): |
| |
34 # start broadway |
| |
35 broadwayd = subprocess.Popen(['gtk4-broadwayd']) |
| |
36 |
| |
37 # run the unit test but set the GDK_BACKEND envvar to broadway |
| |
38 env = {**os.environ, 'GDK_BACKEND': 'broadway'} |
| |
39 |
| |
40 try: |
| |
41 proc = subprocess.run(args=sys.argv[1:], env=env) |
| |
42 finally: |
| |
43 # kill broadway |
| |
44 broadwayd.kill() |
| |
45 |
| |
46 # return the exit code of the unit test |
| |
47 sys.exit(proc.returncode) |
| |
48 |
| |
49 |
| |
50 if __name__ == '__main__': |
| |
51 main() |