gis_set_error.py 844 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. """!
  2. @package gis_set_error.py
  3. GRASS start-up screen error message.
  4. (C) 2010 by the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. @author Martin Landa <landa.martin gmail.com>
  8. """
  9. import os
  10. import sys
  11. import gui_modules.globalvar as globalvar
  12. if not os.getenv("GRASS_WXBUNDLED"):
  13. globalvar.CheckForWx()
  14. import wx
  15. def main():
  16. app = wx.PySimpleApp()
  17. if len(sys.argv) == 1:
  18. msg = "Unknown reason"
  19. else:
  20. msg = ''
  21. for m in sys.argv[1:]:
  22. msg += m
  23. wx.MessageBox(caption = "Error",
  24. message = msg,
  25. style = wx.OK | wx.ICON_ERROR)
  26. app.MainLoop()
  27. if __name__ == "__main__":
  28. main()