forked from robertbasic/pugdebug
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.py
More file actions
executable file
·62 lines (53 loc) · 1.56 KB
/
app.py
File metadata and controls
executable file
·62 lines (53 loc) · 1.56 KB
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
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
pugdebug - a standalone PHP debugger
=========================
copyright: (c) 2015 Robert Basic and fork's contributors
license: GNU GPL v3, see LICENSE for more details
"""
# Fix for Gtk-CRITICAL issues on Ubuntu
# Turn off that stupid overlay scrollbars
import os
os.environ['LIBOVERLAY_SCROLLBAR'] = '0'
import sys
import logging
import argparse
from logging.config import dictConfig
from PyQt5.QtWidgets import QApplication
from pugdebug.pugdebug import Pugdebug
VERSION = '1.1.1'
if __name__ == "__main__":
config = dict(
version=1,
formatters={
'f': {'format': '%(levelname)s %(asctime)s %(message)s'}
},
handlers={
'h': {
'class': 'logging.FileHandler',
'level': logging.DEBUG,
'formatter': 'f',
'filename': os.path.expanduser('~') + '/pugdebug.log'
}
},
root={
'handlers': ['h'],
'level': logging.DEBUG
}
)
parser = argparse.ArgumentParser()
parser.add_argument('--version', help='Version of pugdebug', action="store_true")
args = parser.parse_args()
if args.version:
print('Pubdebug version: ' + VERSION)
sys.exit()
dictConfig(config)
logger = logging.getLogger()
app = QApplication(sys.argv)
logger.debug('Hello pugdebug!')
pugdebug = Pugdebug()
logger.debug('Running pugdebug ...')
pugdebug.run()
app.exit(app.exec_())
logger.debug('Pugdebug finished. Bye!')