wxpyimgview.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 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)