wxpyimgview.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/usr/bin/env python
  2. ############################################################################
  3. #
  4. # MODULE: wxpyimgview
  5. # AUTHOR(S): Glynn Clements <glynn@gclements.plus.com>
  6. # COPYRIGHT: (C) 2010 Glynn Clements
  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. #############################################################################/
  19. #%Module
  20. #% description: View BMP images from the PNG driver.
  21. #% keywords: display
  22. #% keywords: raster
  23. #%End
  24. #%Option
  25. #% key: image
  26. #% type: string
  27. #% required: yes
  28. #% multiple: no
  29. #% description: Image file
  30. #% gisprompt: old_file,file,input
  31. #%End
  32. #%Option
  33. #% key: percent
  34. #% type: integer
  35. #% required: no
  36. #% multiple: no
  37. #% description: Percentage of CPU time to use
  38. #% answer: 10
  39. #%End
  40. import sys
  41. import os
  42. import grass.script as grass
  43. if __name__ == "__main__":
  44. options, flags = grass.parser()
  45. image = options['image']
  46. percent = options['percent']
  47. python = os.getenv('GRASS_PYTHON', 'python')
  48. gisbase = os.environ['GISBASE']
  49. script = os.path.join(gisbase, "etc", "wxpyimgview_gui.py")
  50. os.execlp(python, script, script, image, percent)