[Mesa-dev] [PATCH mesa] intel: various python cleanups
Dylan Baker
dylan at pnwbakers.com
Thu Aug 16 20:24:40 UTC 2018
Quoting Eric Engestrom (2018-08-16 07:43:23)
> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> ---
> Didn't feel like sending 15 patches for these, but I can split out some
> of it if needed.
> ---
> src/intel/genxml/gen_bits_header.py | 1 -
> src/intel/genxml/gen_pack_header.py | 29 ++++++++++++++---------------
> src/intel/genxml/gen_zipped_file.py | 1 -
> src/intel/isl/gen_format_layout.py | 9 ++++-----
> src/intel/vulkan/anv_extensions.py | 7 +++----
> 5 files changed, 21 insertions(+), 26 deletions(-)
>
> diff --git a/src/intel/genxml/gen_bits_header.py b/src/intel/genxml/gen_bits_header.py
> index dcd6ccb7d9ec39109cb0..ded2d2dcfcfd74dbec1d 100644
> --- a/src/intel/genxml/gen_bits_header.py
> +++ b/src/intel/genxml/gen_bits_header.py
> @@ -25,7 +25,6 @@
>
> import argparse
> import os
> -import sys
> import xml.parsers.expat
>
> from mako.template import Template
> diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py
> index c3d712c7a86e1580ec0f..0bf838de8c60cd8744a6 100644
> --- a/src/intel/genxml/gen_pack_header.py
> +++ b/src/intel/genxml/gen_pack_header.py
> @@ -219,9 +219,9 @@ def safe_name(name):
> def num_from_str(num_str):
> if num_str.lower().startswith('0x'):
> return int(num_str, base=16)
> - else:
> - assert not num_str.startswith('0'), 'octals numbers not allowed'
> - return int(num_str)
> +
> + assert not num_str.startswith('0'), 'octals numbers not allowed'
> + return int(num_str)
>
> class Field(object):
> ufixed_pattern = re.compile(r"u(\d+)\.(\d+)")
> @@ -306,7 +306,7 @@ def emit_template_struct(self, dim):
> print(" %-36s %s%s;" % (type, self.name, dim))
>
> prefix = ""
> - if len(self.values) > 0 and self.default == None:
> + if self.values and self.default == None:
Since you changed the other instances to be correct, 'self.default is None'.
With that change,
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180816/e70cefb0/attachment.sig>
More information about the mesa-dev
mailing list