gui: add verbosity args for debugging

This commit is contained in:
Sebastien Bourdeauducq 2015-08-05 11:41:43 +08:00
parent 8f2dfcd08e
commit c8db83b11f
1 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import os
from quamash import QEventLoop, QtGui from quamash import QEventLoop, QtGui
from pyqtgraph import dockarea from pyqtgraph import dockarea
from artiq.tools import verbosity_args, init_logger
from artiq.protocols.pc_rpc import AsyncioClient from artiq.protocols.pc_rpc import AsyncioClient
from artiq.gui.state import StateManager from artiq.gui.state import StateManager
from artiq.gui.explorer import ExplorerDock from artiq.gui.explorer import ExplorerDock
@ -39,6 +40,7 @@ def get_argparser():
parser.add_argument( parser.add_argument(
"--db-file", default="artiq_gui.pyon", "--db-file", default="artiq_gui.pyon",
help="database file for local GUI settings") help="database file for local GUI settings")
verbosity_args(parser)
return parser return parser
@ -55,12 +57,14 @@ class _MainWindow(QtGui.QMainWindow):
def main(): def main():
args = get_argparser().parse_args()
init_logger(args)
app = QtGui.QApplication([]) app = QtGui.QApplication([])
loop = QEventLoop(app) loop = QEventLoop(app)
asyncio.set_event_loop(loop) asyncio.set_event_loop(loop)
atexit.register(lambda: loop.close()) atexit.register(lambda: loop.close())
args = get_argparser().parse_args()
smgr = StateManager(args.db_file) smgr = StateManager(args.db_file)
schedule_ctl = AsyncioClient() schedule_ctl = AsyncioClient()