Debian Codegraph @

ui/qrazercfg-applet

raw symbols SCIP
1 #!/usr/bin/env python3
2 #
3 # Razer device QT configuration tool
4 #
5 # Copyright (C) 2007-2018 Michael Buesch <[email protected]>
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 import sys
18 import traceback
19 from PyQt6.QtCore import *
20 from PyQt6.QtGui import *
21 from PyQt6.QtWidgets import *
22
23 import pyrazer
24 from pyrazer import ui
25
26 def main():
27 try:
28 ui.razer = pyrazer.Razer(enableNotifications=True)
29 except pyrazer.RazerEx as e:
30 print(e)
31 return 1
32
33 app = QApplication(sys.argv)
34 try:
35 # check if systray is available at freedesktop
36 if not QSystemTrayIcon.isSystemTrayAvailable():
37 print("No system tray available")
38 return 1
39 applet = ui.RazerApplet()
40 applet.show()
41 return app.exec()
42 except pyrazer.RazerEx as e:
43 QMessageBox.critical(None,
44 "qrazercfg-applet - Fatal exception",
45 "qrazercfg-applet - A fatal exception occurred:\n\n"
46 "%s\n\n"
47 "%s" % (str(e), traceback.format_exc()))
48 raise e
49
50 if __name__ == "__main__":
51 sys.exit(main())