File: run_ui_css_edition.py

package info (click to toggle)
jtdx 2.2.159%2Bimproved-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,336 kB
  • sloc: cpp: 38,503; f90: 31,141; python: 27,061; ansic: 11,772; sh: 409; fortran: 353; makefile: 232
file content (52 lines) | stat: -rw-r--r-- 1,409 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Process qrc and ui files, then run example in while loop."""

from __future__ import absolute_import, print_function

import sys
from subprocess import call


def main():
    """Process qrc and ui files, then run example in while loop."""
    dark = None
    no_dark = None

    while True:
        try:
            dark.kill()
        except AttributeError:
            print('Dark not running!')
        except Exception:
            print('Dark still running!')
        else:
            print('Dark was killed!')

        try:
            no_dark.kill()
        except AttributeError:
            print('No Dark not running!')
        except Exception:
            print('No Dark still running!')
        else:
            print('No Dark was killed!')

        print(sys.argv)

        # process qrc files
        call(['python', 'process_qrc.py'])
        # process ui files
        call(['python', 'process_ui.py'])
        # open dark example
        dark = call(['python', '../example/example.py'] + sys.argv[1:])
        # open no dark example
        no_dark = call(['python', '../example/example.py', '--no_dark'] + sys.argv[1:])

        if dark or no_dark:
            print('Unf! It not worked! Please, check the error(s).')
            break


if __name__ == "__main__":
    sys.exit(main())