partmgr-gui 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # PartMgr GUI
  5. #
  6. # Copyright 2014 Michael Buesch <m@bues.ch>
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License along
  19. # with this program; if not, write to the Free Software Foundation, Inc.,
  20. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. #
  22. import sys
  23. if sys.version_info.major < 3:
  24. raise Exception("partmgr needs Python 3.x")
  25. from partmgr.gui.mainwindow import *
  26. def main(argv):
  27. app = QApplication(argv)
  28. mainwnd = PartMgrMainWindow()
  29. if len(argv) == 2:
  30. if not mainwnd.loadDatabaseFile(argv[1]):
  31. return 1
  32. mainwnd.show()
  33. return app.exec()
  34. if __name__ == "__main__":
  35. sys.exit(main(sys.argv))