g.gui.psmap.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env python
  2. ############################################################################
  3. #
  4. # MODULE: g.gui.psmap
  5. # AUTHOR(S): Anna Kratochvilova <kratochanna gmail.com>
  6. # PURPOSE: Cartographic Composer
  7. # COPYRIGHT: (C) 2011-2012 by Anna Kratochvilova, and the GRASS Development Team
  8. #
  9. # This program is free software; you can redistribute 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: Tool for creating hardcopy map outputs.
  22. #% keywords: general
  23. #% keywords: GUI
  24. #% keywords: printing
  25. #%end
  26. #%option G_OPT_F_INPUT
  27. #% key: file
  28. #% label: File containing mapping instructions to load
  29. #% description: See ps.map manual for details
  30. #% key_desc: name
  31. #% required: no
  32. #%end
  33. import os
  34. import wx
  35. import grass.script as grass
  36. from core.globalvar import CheckWxVersion
  37. from core.utils import _, GuiModuleMain
  38. from psmap.frame import PsMapFrame
  39. from psmap.instructions import Instruction
  40. def main():
  41. app = wx.App()
  42. if not CheckWxVersion([2, 9]):
  43. wx.InitAllImageHandlers()
  44. frame = PsMapFrame(parent = None)
  45. frame.Show()
  46. if options['file']:
  47. frame.LoadFile(options['file'])
  48. app.MainLoop()
  49. if __name__ == "__main__":
  50. options, flags = grass.parser()
  51. GuiModuleMain(main)