[GRASS-SVN] r54227 - grass/trunk/gui/wxpython/psmap

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 6 13:33:59 PST 2012


Author: annakrat
Date: 2012-12-06 13:33:59 -0800 (Thu, 06 Dec 2012)
New Revision: 54227

Modified:
   grass/trunk/gui/wxpython/psmap/frame.py
   grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
Log:
wxGUI/psmap: implement file option

Modified: grass/trunk/gui/wxpython/psmap/frame.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/frame.py	2012-12-06 21:21:21 UTC (rev 54226)
+++ grass/trunk/gui/wxpython/psmap/frame.py	2012-12-06 21:33:59 UTC (rev 54227)
@@ -382,7 +382,7 @@
             instrFile.close()   
             
     def OnLoadFile(self, event):
-        """!Load file and read instructions"""
+        """!Launch file dialog and load selected file"""
         #find file
         filename = ''
         dlg = wx.FileDialog(self, message = "Find instructions file", defaultDir = "", 
@@ -394,6 +394,10 @@
         if not filename:
             return
         # load instructions
+        self.LoadFile(filename)
+
+    def LoadFile(self, filename):
+        """!Load file and read instructions"""
         readObjectId = []
         readInstruction = Instruction(parent = self, objectsToDraw = readObjectId)
         ok = readInstruction.Read(filename)
@@ -410,7 +414,7 @@
             #self.canvas.ZoomAll()
             
             self.DialogDataChanged(self.objectId)
-            
+
     def OnPageSetup(self, event = None):
         """!Specify paper size, margins and orientation"""
         id = self.instruction.FindInstructionByType('page').id

Modified: grass/trunk/gui/wxpython/psmap/g.gui.psmap.py
===================================================================
--- grass/trunk/gui/wxpython/psmap/g.gui.psmap.py	2012-12-06 21:21:21 UTC (rev 54226)
+++ grass/trunk/gui/wxpython/psmap/g.gui.psmap.py	2012-12-06 21:33:59 UTC (rev 54227)
@@ -6,7 +6,7 @@
 # PURPOSE:   Cartographic Composer
 # COPYRIGHT: (C) 2011-2012 by Anna Kratochvilova, and the GRASS Development Team
 #
-#  This program is free software; you can 1redistribute it and/or
+#  This program is free software; you can redistribute it and/or
 #  modify it under the terms of the GNU General Public License as
 #  published by the Free Software Foundation; either version 2 of the
 #  License, or (at your option) any later version.
@@ -51,11 +51,11 @@
     app = wx.PySimpleApp()
     wx.InitAllImageHandlers()
     frame = PsMapFrame(parent = None)
+    frame.Show()
+
     if options['file']:
-        grass.fatal(_("To be implemented"))
-    
-    frame.Show()
-    
+        frame.LoadFile(options['file'])
+
     app.MainLoop()
 
 if __name__ == "__main__":



More information about the grass-commit mailing list