- str = name.replace('@', '_at_')
- str = str.replace('-', '_')
- str = str.replace(',', '_')
- str = str.replace('.', '_')
- str = str.replace('/', '__')
- return str
-
-def TabTo(num_tabs, str):
- if len(str) >= num_tabs * 8:
- return str + ' '
- return str + '\t' * (num_tabs - len(str) // 8)
-
-class DtbPlatdata:
+ new = name.replace('@', '_at_')
+ new = new.replace('-', '_')
+ new = new.replace(',', '_')
+ new = new.replace('.', '_')
+ new = new.replace('/', '__')
+ return new
+
+def tab_to(num_tabs, line):
+ """Append tabs to a line of text to reach a tab stop.
+
+ Args:
+ num_tabs: Tab stop to obtain (0 = column 0, 1 = column 8, etc.)
+ line: Line of text to append to
+
+ Returns:
+ line with the correct number of tabs appeneded. If the line already
+ extends past that tab stop then a single space is appended.
+ """
+ if len(line) >= num_tabs * 8:
+ return line + ' '
+ return line + '\t' * (num_tabs - len(line) // 8)
+
+class DtbPlatdata(object):