g.gui.rlisetup.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/env python
  2. ############################################################################
  3. #
  4. # MODULE: g.gui.rlisetup
  5. # AUTHOR(S): Luca Delucchi <lucadeluge gmail.com>
  6. # PURPOSE: RLi Setup to create configuration file for r.li modules
  7. # COPYRIGHT: (C) 2012 by Luca Delucchi, and the GRASS Development Team
  8. #
  9. # This program is free software; you can 1redistribute it and/or
  10. # modify it under the terms of the GNU General Public License as
  11. # published by the Free Software Foundation; either version 2 of the
  12. # License, or (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # General Public License for more details.
  18. #
  19. ############################################################################
  20. #%module
  21. #% description: Configuration tool for r.li modules.
  22. #% keywords: general
  23. #% keywords: GUI
  24. #% keywords: raster
  25. #% keywords: landscape structure analysis
  26. #%end
  27. import os
  28. import sys
  29. import gettext
  30. import wx
  31. import grass.script as grass
  32. wxbase = os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython')
  33. if wxbase not in sys.path:
  34. sys.path.append(wxbase)
  35. from core.giface import StandaloneGrassInterface
  36. from core.globalvar import CheckWxVersion
  37. from rlisetup.frame import RLiSetupFrame
  38. def main():
  39. gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'),
  40. unicode = True)
  41. app = wx.PySimpleApp()
  42. if not CheckWxVersion([2, 9]):
  43. wx.InitAllImageHandlers()
  44. frame = RLiSetupFrame(parent = None, giface = StandaloneGrassInterface())
  45. frame.Show()
  46. app.MainLoop()
  47. if __name__ == "__main__":
  48. options, flags = grass.parser()
  49. main()