]> git.mxchange.org Git - flightgear.git/commitdiff
lsprop: fix -p long option
authormfranz <mfranz>
Mon, 18 Aug 2008 13:12:31 +0000 (13:12 +0000)
committermfranz <mfranz>
Mon, 18 Aug 2008 13:12:31 +0000 (13:12 +0000)
scripts/tools/lsprop

index 295b768402cdea345be9c6f11726939ac7d328e6..9e97db488995e1085fc13e7e4cded99902b8a27b 100755 (executable)
@@ -149,12 +149,12 @@ class parse_xml_file(xml.sax.handler.ContentHandler):
                                        "t": self.type,
                                        "V": value,
                                        "v": cooked_value,
-                                       "v'": cooked_value.replace("'", "\\'"),
-                                       'v"': cooked_value.replace('"', '\\"'),
+                                       "'v": cooked_value.replace("'", "\\'"),
+                                       '"v': cooked_value.replace('"', '\\"'),
                                }
 
                elif len(string.strip(value)):
-                       raise XMLError(self.locator, "garbage found '" + string.strip(value) + "'")
+                       raise XMLError(self.locator, "garbage found '%s'" % string.strip(value))
 
                self.level -= 1
                if self.level:
@@ -195,8 +195,10 @@ class parse_xml_file(xml.sax.handler.ContentHandler):
 
        def warning(self, exception):
                raise XMLError(self.locator, "WARNING: " + str(exception))
+
        def error(self, exception):
                raise XMLError(self.locator, "ERROR: " + str(exception))
+
        def fatalError(self, exception):
                raise XMLError(self.locator, "FATAL: " + str(exception))
 
@@ -212,8 +214,8 @@ def main():
        # options
        try:
                opts, args = getopt.getopt(sys.argv[1:], \
-                               "hviIf:p", \
-                               ["help", "verbose", "all-indices", "no-indices", "format=", "unify-paths"])
+                               "hviIpf:", \
+                               ["help", "verbose", "all-indices", "no-indices", "raw-paths", "format="])
        except getopt.GetoptError, msg:
                print >>sys.stderr, str(msg)
                return 0
@@ -249,8 +251,8 @@ def main():
        f = f.replace("%t", "\x01(t)s")
        f = f.replace("%V", "\x01(V)s")
        f = f.replace("%v", "\x01(v)s")
-       f = f.replace("%'v", "\x01(v')s")
-       f = f.replace('%"v', '\x01(v")s')
+       f = f.replace("%'v", "\x01('v)s")
+       f = f.replace('%"v', '\x01("v)s')
        f = f.replace("%", "%%")
        f = f.replace("\x01", "%")
        config.cooked_format = f
@@ -258,6 +260,7 @@ def main():
        if config.verbose > 2:
                print >>sys.stderr, "internal format = [%s]" % config.cooked_format
 
+       # arguments
        if not len(args):
                args = [config.root + "/preferences.xml"]
                if not os.path.exists(args[0]):
@@ -284,3 +287,4 @@ def main():
 
 if __name__ == "__main__":
        sys.exit(main())
+