qrazercfg 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env python3
  2. #
  3. # Razer device QT configuration tool
  4. #
  5. # Copyright (C) 2007-2016 Michael Buesch <m@bues.ch>
  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. import sys
  17. import traceback
  18. from PySide.QtCore import *
  19. from PySide.QtGui import *
  20. import pyrazer
  21. from pyrazer import ui
  22. def main():
  23. try:
  24. ui.razer = pyrazer.Razer(enableNotifications=True)
  25. except pyrazer.RazerEx as e:
  26. print(e)
  27. return 1
  28. app = QApplication(sys.argv)
  29. try:
  30. mainwnd = ui.MainWindow()
  31. mainwnd.show()
  32. return app.exec_()
  33. except pyrazer.RazerEx as e:
  34. QMessageBox.critical(None,
  35. "qrazercfg - Fatal exception",
  36. "qrazercfg - A fatal exception occurred:\n\n"
  37. "%s\n\n"
  38. "%s" % (str(e), traceback.format_exc()))
  39. raise e
  40. if __name__ == "__main__":
  41. sys.exit(main())