diff options
author | Mark Spruiell <mes@zeroc.com> | 2007-08-20 16:32:26 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2007-08-20 16:32:26 -0700 |
commit | 8b85a8591b905af4d64665f0c0e7b658539ab11c (patch) | |
tree | a2dfb185138a6b50fb47ec1990406a6f3230b112 /cpp/config/makeprops.py | |
parent | Fixed comments and also ignore socket exception with thread per connection (diff) | |
download | ice-8b85a8591b905af4d64665f0c0e7b658539ab11c.tar.bz2 ice-8b85a8591b905af4d64665f0c0e7b658539ab11c.tar.xz ice-8b85a8591b905af4d64665f0c0e7b658539ab11c.zip |
bug 1597: minor cleanup in makeprops
Diffstat (limited to 'cpp/config/makeprops.py')
-rw-r--r-- | cpp/config/makeprops.py | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/cpp/config/makeprops.py b/cpp/config/makeprops.py index c66ead4588a..5933fd2cb37 100644 --- a/cpp/config/makeprops.py +++ b/cpp/config/makeprops.py @@ -391,23 +391,21 @@ class JavaPropertyHandler(PropertyHandler): self.srcFile.write(javaPreamble % {'inputfile' : self.inputfile, 'classname' : self.className}) def closeFiles(self): - self.srcFile.write("\n public static final Property[] validProps[] = \n" % \ - {'classname' : self.className}) + self.srcFile.write("\n public static final Property[] validProps[] =\n") self.srcFile.write(" {\n") for s in self.sections: self.srcFile.write(" %sProps,\n" % s) self.srcFile.write(" null\n") - self.srcFile.write(" };\n\n") + self.srcFile.write(" };\n") - self.srcFile.write("\n public static final String clPropNames[] =\n" % \ - {'classname' : self.className}) + self.srcFile.write("\n public static final String clPropNames[] =\n") self.srcFile.write(" {\n") for s in self.cmdLineOptions: self.srcFile.write(" \"%s\",\n" % s) self.srcFile.write(" null\n") - self.srcFile.write(" };\n\n") - self.srcFile.write("};\n\n") + self.srcFile.write(" };\n") + self.srcFile.write("}\n") self.srcFile.close() def fix(self, propertyName): @@ -460,8 +458,7 @@ class CSPropertyHandler(PropertyHandler): self.srcFile.write(csPreamble % {'inputfile' : self.inputfile, 'classname' : self.className}) def closeFiles(self): - self.srcFile.write(" public static Property[][] validProps = \n" % \ - {'classname' : self.className}) + self.srcFile.write(" public static Property[][] validProps =\n") self.srcFile.write(" {\n") for s in self.sections: @@ -469,8 +466,7 @@ class CSPropertyHandler(PropertyHandler): self.srcFile.write(" null\n") self.srcFile.write(" };\n\n") - self.srcFile.write(" public static string[] clPropNames =\n" % \ - {'classname' : self.className}) + self.srcFile.write(" public static string[] clPropNames =\n") self.srcFile.write(" {\n") for s in self.cmdLineOptions: self.srcFile.write(" \"%s\",\n" % s) @@ -567,24 +563,19 @@ def main(): infile = None lang = None - toplevel = '..' # - # TODO: Why does determining the top level directory depend on which - # arguments are used? + # Find the root of the tree. # - if len(sys.argv) == 1: - # - # Find where the root of the tree is. - # - for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "makeprops.py")): - break - else: - progError("cannot find top-level directory") - sys.exit(1) + for toplevel in [".", "..", "../..", "../../..", "../../../.."]: + toplevel = os.path.normpath(toplevel) + if os.path.exists(os.path.join(toplevel, "config", "makeprops.py")): + break + else: + progError("cannot find top-level directory") + sys.exit(1) + if len(sys.argv) == 1: infile = os.path.join(toplevel, "config", "PropertyNames.xml") else: option = sys.argv[1] |