g.gui.psmap.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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: user interface
  24. #% keywords: GUI
  25. #% keywords: printing
  26. #%end
  27. #%option G_OPT_F_INPUT
  28. #% key: file
  29. #% label: File containing mapping instructions to load
  30. #% description: See ps.map manual for details
  31. #% key_desc: name
  32. #% required: no
  33. #%end
  34. import os
  35. import wx
  36. import grass.script as grass
  37. from core.globalvar import CheckWxVersion
  38. from core.utils import _, GuiModuleMain
  39. from psmap.frame import PsMapFrame
  40. from psmap.instructions import Instruction
  41. def main():
  42. app = wx.App()
  43. if not CheckWxVersion([2, 9]):
  44. wx.InitAllImageHandlers()
  45. frame = PsMapFrame(parent = None)
  46. frame.Show()
  47. if options['file']:
  48. frame.LoadFile(options['file'])
  49. app.MainLoop()
  50. if __name__ == "__main__":
  51. options, flags = grass.parser()
  52. GuiModuleMain(main)