gis_set_error.py 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. """
  2. @package gis_set_error
  3. GRASS start-up screen error message.
  4. (C) 2010-2011 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. # i18n is taken care of in the grass library code.
  12. # So we need to import it before any of the GUI code.
  13. # NOTE: in this particular case, we don't really need the grass library;
  14. # NOTE: we import it just for the side effects of gettext.install()
  15. import grass
  16. from core import globalvar
  17. import wx
  18. def main():
  19. app = wx.App()
  20. if len(sys.argv) == 1:
  21. msg = "Unknown reason"
  22. else:
  23. msg = ''
  24. for m in sys.argv[1:]:
  25. msg += m
  26. wx.MessageBox(caption="Error",
  27. message=msg,
  28. style=wx.OK | wx.ICON_ERROR)
  29. app.MainLoop()
  30. if __name__ == "__main__":
  31. main()