Przeglądaj źródła

wxGUI: update_menudata.py - write end of line

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41148 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 lat temu
rodzic
commit
bd466c06a7
1 zmienionych plików z 12 dodań i 3 usunięć
  1. 12 3
      gui/wxpython/support/update_menudata.py

+ 12 - 3
gui/wxpython/support/update_menudata.py

@@ -7,7 +7,7 @@ updates: - description (i.e. help) - keywords
 
 Prints warning for missing modules.
 
-(C) 2008-2009 by the GRASS Development Team
+(C) 2008-2010 by the GRASS Development Team
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
@@ -110,8 +110,17 @@ def writeData(data):
         data.tree.write(file)
     except IOError:
         print >> sys.stderr, "'%s' not found. Please run the script from 'gui/wxpython'." % file
-        
-
+        return
+    
+    try:
+        f = open(file, 'a')
+        try:
+            f.write('\n')
+        finally:
+            f.close()
+    except IOError:
+        print >> sys.stderr, "ERROR: Unable to write to menudata file."
+    
 def main(argv = None):
     if argv is None:
         argv = sys.argv