<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 31, 2016 at 2:30 PM, Dylan Baker <span dir="ltr"><<a href="mailto:dylan@pnwbakers.com" target="_blank">dylan@pnwbakers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is the default in python3, but in python2 you get old style<br>
classes. No one likes old-style classes.<br>
<br>
Signed-off-by: Dylan Baker <<a href="mailto:dylanx.c.baker@intel.com">dylanx.c.baker@intel.com</a>><br>
---<br>
src/intel/genxml/gen_pack_header.py | 16 ++++++++++++----<br>
1 file changed, 12 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py<br>
index 2920ec9..ddaa234 100644<br>
--- a/src/intel/genxml/gen_pack_header.py<br>
+++ b/src/intel/genxml/gen_pack_header.py<br>
@@ -168,6 +168,7 @@ __gen_ufixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits)<br>
<br>
"""<br>
<br>
+<br></blockquote><div><br></div><div>Lots of extra new lines in this patch<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
def to_alphanum(name):<br>
substitutions = {<br>
' ': '',<br>
@@ -196,6 +197,7 @@ def to_alphanum(name):<br>
<br>
return name<br>
<br>
+<br>
def safe_name(name):<br>
name = to_alphanum(name)<br>
if not str.isalpha(name[0]):<br>
@@ -203,6 +205,7 @@ def safe_name(name):<br>
<br>
return name<br>
<br>
+<br>
def num_from_str(num_str):<br>
if num_str.lower().startswith('0x'):<br>
return int(num_str, base=16)<br>
@@ -210,7 +213,8 @@ def num_from_str(num_str):<br>
assert(not num_str.startswith('0') and 'octals numbers not allowed')<br>
return int(num_str)<br>
<br>
-class Field:<br>
+<br>
+class Field(object):<br>
ufixed_pattern = re.compile("u(\d+)\.(\d+)")<br>
sfixed_pattern = re.compile("s(\d+)\.(\d+)")<br>
<br>
@@ -279,7 +283,8 @@ class Field:<br>
for value in self.values:<br>
print("#define %-40s %d" % (prefix + <a href="http://value.name" rel="noreferrer" target="_blank">value.name</a>, value.value))<br>
<br>
-class Group:<br>
+<br>
+class Group(object):<br>
def __init__(self, parser, parent, start, count, size):<br>
self.parser = parser<br>
self.parent = parent<br>
@@ -467,12 +472,14 @@ class Group:<br>
print(" dw[%d] = %s;" % (index, v))<br>
print(" dw[%d] = %s >> 32;" % (index + 1, v))<br>
<br>
-class Value:<br>
+<br>
+class Value(object):<br>
def __init__(self, attrs):<br>
<a href="http://self.name" rel="noreferrer" target="_blank">self.name</a> = safe_name(attrs["name"])<br>
self.value = int(attrs["value"])<br>
<br>
-class Parser:<br>
+<br>
+class Parser(object):<br>
def __init__(self):<br>
self.parser = xml.parsers.expat.ParserCreate()<br>
self.parser.StartElementHandler = self.start_element<br>
@@ -631,6 +638,7 @@ class Parser:<br>
self.parser.ParseFile(file)<br>
file.close()<br>
<br>
+<br>
if len(sys.argv) < 2:<br>
print("No input xml file specified")<br>
sys.exit(1)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.8.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>