mail[Wesnoth-commits] r20637 - /trunk/data/tools/wmlscope


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by esr on September 21, 2007 - 09:32:
Author: esr
Date: Fri Sep 21 09:31:34 2007
New Revision: 20637

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20637&view=rev
Log:
Sort cross-reference results by key.

Modified:
    trunk/data/tools/wmlscope

Modified: trunk/data/tools/wmlscope
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlscope?rev=20637&r1=20636&r2=20637&view=diff
==============================================================================
--- trunk/data/tools/wmlscope (original)
+++ trunk/data/tools/wmlscope Fri Sep 21 09:31:34 2007
@@ -89,7 +89,9 @@
     "Cross-reference generator with reporting functions"
     def xrefdump(self, pred=None):
         "Report resolved macro references."
-        for name in self.xref:
+        sorted = self.xref.keys()
+        sorted.sort()
+        for name in sorted:
             for defn in self.xref[name]:
                 if pred and not pred(name, defn):
                     continue
@@ -103,7 +105,10 @@
                 else:
                     print "%s: %s macro %s is used in %d files:" % (defn, 
type, name, nrefs)
                 defn.dump_references()
-        for (name, defloc) in self.fileref.items():
+        sorted = self.fileref.keys()
+        sorted.sort()
+        for name in sorted:
+            defloc = self.fileref[name]
             if pred and not pred(name, defloc):
                 continue
             nrefs = len(defloc.references)
@@ -123,11 +128,16 @@
                 print "%s -> %s" % (reference, name)
     def deflist(self, pred=None):
         "List all resource definitions."
-        for name in self.xref:
+        sorted = self.xref.keys()
+        sorted.sort()
+        for name in sorted:
             for defn in self.xref[name]:
                 if not pred or pred(name, defn):
                     print name
-        for (name, defloc) in self.fileref.items():
+        sorted = self.fileref.keys()
+        sorted.sort()
+        for name in sorted:
+            defloc = self.fileref[name]
             if not pred or pred(name, defloc):
                 print name
     def extracthelp(self, pref, fp):




Related Messages


Powered by MHonArc, Updated Fri Sep 21 10:20:42 2007