wxpyimgview.py 1.5 KB

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