Author: esr
Date: Thu Oct 16 20:03:00 2008
New Revision: 30205

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30205&view=rev
Log:
trackplacer: fix a bug in the deletion logic.

Modified:
    trunk/data/tools/trackplacer

Modified: trunk/data/tools/trackplacer
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/trackplacer?rev=30205&r1=30204&r2=30205&view=diff
==============================================================================
--- trunk/data/tools/trackplacer (original)
+++ trunk/data/tools/trackplacer Thu Oct 16 20:03:00 2008
@@ -298,10 +298,14 @@
         if found:
             # Prefer to delete the most recent feature
             track = self.selected_track()
-            track = track[:found[-1]] + track[found[-1]+1:]
+            self.tracks[self.selected_id] = track[:found[-1]] + 
track[found[-1]+1:]
             self.modified += 1
     def __str__(self):
-        return self.mapfile + ": " + `self.tracks`
+        rep = self.mapfile + ":n"
+        for name in self.track_order:
+            track = self.tracks[name]
+            rep += name + ": " + `track` + "\n"
+        return rep
 
 class TrackEditorIcon:
     def __init__(self, action, path):
@@ -979,7 +983,7 @@
         self.redraw(self.drawing_area, 0.5)
 
     def log(self, msg):
-        "Notify user of error and die."
+        "Debugging report."
         if self.verbose:
             print >>sys.stderr, "trackplacer:", msg
 
@@ -1011,7 +1015,11 @@
         wesnoth.wmltools.pop_to_top("trackplacer")
     if arguments:
         try:
-            TracksEditor(path=os.path.join(here, arguments[0]), 
verbose=verbose)
+            filename = os.path.join(here, arguments[0])
+            # Relativize file path to current directory
+            if filename.startswith(os.getcwd()):
+                filename = filename[len(os.getcwd())+1:]
+            TracksEditor(path=filename, verbose=verbose)
         except IOException, e:
             if e.lineno:
                 sys.stderr.write(('"%s", line %d: ' % (e.path, e.lineno)) + 
e.message + "\n")


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to