wxpyimgview.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/env python3
  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: Views BMP images from the PNG driver.
  21. #% keyword: display
  22. #% keyword: graphics
  23. #% keyword: raster
  24. #%end
  25. #%option G_OPT_F_INPUT
  26. #% key: image
  27. #% description: Name of input image file
  28. #%end
  29. #%option
  30. #% key: percent
  31. #% type: integer
  32. #% required: no
  33. #% multiple: no
  34. #% description: Percentage of CPU time to use
  35. #% answer: 10
  36. #%end
  37. import sys
  38. import os
  39. import grass.script as grass
  40. if __name__ == "__main__":
  41. options, flags = grass.parser()
  42. image = options['image']
  43. percent = options['percent']
  44. python = os.getenv('GRASS_PYTHON', 'python')
  45. gisbase = os.environ['GISBASE']
  46. script = os.path.join(gisbase, "etc", "wxpyimgview_gui.py")
  47. os.execlp(python, script, script, image, percent)