~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to gui/wxpython/psmap/g.gui.psmap.py

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
21
#%module
 
22
#% description: Tool for creating hardcopy map outputs.
 
23
#% keyword: general
 
24
#% keyword: GUI
 
25
#% keyword: 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
 
 
35
import os
 
36
 
 
37
import  wx
 
38
 
 
39
import grass.script as grass
 
40
 
 
41
from core.globalvar import CheckWxVersion
 
42
from core.utils import _, GuiModuleMain
 
43
from psmap.frame import PsMapFrame
 
44
from psmap.instructions import Instruction
 
45
 
 
46
def main():
 
47
    app = wx.App()
 
48
    if not CheckWxVersion([2, 9]):
 
49
        wx.InitAllImageHandlers()
 
50
    frame = PsMapFrame(parent = None)
 
51
    frame.Show()
 
52
 
 
53
    if options['file']:
 
54
        frame.LoadFile(options['file'])
 
55
 
 
56
    app.MainLoop()
 
57
 
 
58
if __name__ == "__main__":
 
59
    options, flags = grass.parser()
 
60
    
 
61
    GuiModuleMain(main)