From b46deb1417dc3596e9ac9fe2fe8cc0b7f42457e7 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 26 Oct 2015 06:29:00 +0000 Subject: "Any programmer who fails to comply with the standard naming, formatting, or commenting conventions should be shot. If it so happens that it is inconvenient to shoot him, then he is to be politely requested to recode his program in adherence to the above standard." -- Michael Spier, Digital Equipment Corporation svn path=/branches/tk705/; revision=6152 --- buildtools/defstack.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'buildtools/defstack.py') diff --git a/buildtools/defstack.py b/buildtools/defstack.py index 757516f3..b3df0777 100644 --- a/buildtools/defstack.py +++ b/buildtools/defstack.py @@ -8,11 +8,11 @@ # code with code maintained by humans, so "nasty" is a relative term. # # Copyright (C) 2011-2012 Internet Systems Consortium ("ISC") -# +# # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. -# +# # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, @@ -68,7 +68,7 @@ template = ''' ''' if len(sys.argv) < 2: - sys.exit("Usage: %s source.c [source.c ...]" % sys.argv[0]) + sys.exit("Usage: %s source.c [source.c ...]" % sys.argv[0]) splitter = re.compile("[() \t]+").split @@ -76,16 +76,16 @@ token = None for line in fileinput.input(): - if token is None: - path = fileinput.filename().split(os.path.sep) - path = os.path.join(path[-2], path[-1]) if len(path) > 1 else path[-1] - token = "".join(c if c.isalnum() else "_" for c in path.upper()) - sys.stdout.write(header.replace("%", token)) + if token is None: + path = fileinput.filename().split(os.path.sep) + path = os.path.join(path[-2], path[-1]) if len(path) > 1 else path[-1] + token = "".join(c if c.isalnum() else "_" for c in path.upper()) + sys.stdout.write(header.replace("%", token)) - if "DECLARE_STACK_OF" in line: - words = splitter(line) - if len(words) > 1 and words[0] == "DECLARE_STACK_OF": - sys.stdout.write(template.replace("%", words[1])) + if "DECLARE_STACK_OF" in line: + words = splitter(line) + if len(words) > 1 and words[0] == "DECLARE_STACK_OF": + sys.stdout.write(template.replace("%", words[1])) if token is not None: - sys.stdout.write(footer.replace("%", token)) + sys.stdout.write(footer.replace("%", token)) -- cgit v1.2.3