gis_set_error.py 908 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 sys
  10. # i18n is taken care of in the grass library code.
  11. # So we need to import it before any of the GUI code.
  12. # NOTE: in this particular case, we don't really need the grass library;
  13. # NOTE: we import it just for the side effects of gettext.install()
  14. import wx
  15. def main():
  16. app = wx.App()
  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()