Browse files

Whitespace changes.

  • Loading branch information...
1 parent 885cf62 commit a7acd426ac69d94cfe5d40c436ede49cde1d8c8b Peter Seebach committed Apr 5, 2011
Showing with 28 additions and 25 deletions.
  1. +3 −0 ChangeLog.txt
  2. +15 −15 makewrappers
  3. +10 −10 templatefile.py
View
3 ChangeLog.txt
@@ -1,3 +1,6 @@
+2011-04-04:
+ * (seebs) whitespace cleanup for Python code
+
2011-04-01:
* (seebs) update README
View
30 makewrappers
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright (c) 2008-2010 Wind River Systems, Inc.
+# Copyright (c) 2008-2011 Wind River Systems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License version 2.1 as
@@ -211,9 +211,9 @@ class Function:
self.flags = '0'
self.port = port
self.directory = ''
- # On Darwin, some functions are SECRETLY converted to foo$INODE64
- # when called. So we have to look those up for real_*
- self.inode64 = None
+ # On Darwin, some functions are SECRETLY converted to foo$INODE64
+ # when called. So we have to look those up for real_*
+ self.inode64 = None
self.real_func = None
self.paths_to_munge = []
self.hand_wrapped = None
@@ -275,9 +275,9 @@ class Function:
def maybe_inode64(self):
if self.inode64 and os.uname()[0] == 'Darwin':
- return "$INODE64"
- else:
- return ""
+ return "$INODE64"
+ else:
+ return ""
def end_maybe_skip(self):
if self.hand_wrapped:
@@ -340,16 +340,16 @@ class Function:
return "\n\t\t\t".join(free_paths)
def real_predecl(self):
- if self.real_func:
- return self.decl().replace(self.name, self.real_func, 1) + ";"
- else:
- return ""
+ if self.real_func:
+ return self.decl().replace(self.name, self.real_func, 1) + ";"
+ else:
+ return ""
def real_init(self):
- if self.real_func:
- return self.real_func
- else:
- return "NULL"
+ if self.real_func:
+ return self.real_func
+ else:
+ return "NULL"
def rc_return(self):
"""return rc (or just return)"""
View
20 templatefile.py
@@ -16,7 +16,7 @@ def __init__(self, path):
# empty footer if none specified:
self.sections['footer'] = []
- # empty per-port if none specified:
+ # empty per-port if none specified:
self.sections['port'] = []
# lines appended to body by default
@@ -47,10 +47,10 @@ def __init__(self, path):
current.append(line)
self.template.close()
for section, data in self.sections.items():
- if len(data) > 0:
+ if len(data) > 0:
self.sections[section] = Template("\n".join(data))
- else:
- self.sections[section] = None
+ else:
+ self.sections[section] = None
# You need a file if this isn't a file-per-item
if not self.file_per_item:
@@ -92,20 +92,20 @@ def emit(self, template, item=None):
"""Emit a template, with optional interpolation of an item."""
if template == "copyright":
# hey, at least it's not a global variable, amirite?
- self.get_file(item)
- if self.file:
+ self.get_file(item)
+ if self.file:
self.file.write(TemplateFile.copyright)
elif template in self.sections:
templ = self.sections[template]
- if templ:
- self.get_file(item)
- if self.file:
+ if templ:
+ self.get_file(item)
+ if self.file:
self.file.write(templ.safe_substitute(item))
self.file.write("\n")
else:
print "Warning: Unknown template '%s'." % template
if self.file_per_item:
- if self.file:
+ if self.file:
self.file.close()
self.file = None

0 comments on commit a7acd42

Please sign in to comment.