Re: [PATCH v3 08/11] hyperv: update wmi code generator.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-03-30 22:41 GMT+02:00 Dawid Zamirski <dzamirski@xxxxxxxxx>:
> This patch updates the code generator that outputs C headers and code
> for WMI classes. It has been updated to handle multiple versions (or
> namespaces) of the same class which were introduced with Hyperv 2012+
> ---
>
> changes in v3:
>  * do not change file mode
>  * restore accidentally deleted copyright notice
>
>  src/hyperv/hyperv_wmi_generator.py | 387 +++++++++++++++++++++++++++----------
>  1 file changed, 283 insertions(+), 104 deletions(-)
>
> diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py
> index 8c62882..ccad04d 100755
> --- a/src/hyperv/hyperv_wmi_generator.py
> +++ b/src/hyperv/hyperv_wmi_generator.py

> @@ -279,31 +467,22 @@ def main():
>          if block is not None:
>              if line == "end":
>                  if block[0][1].startswith("class"):
> -                    cls = parse_class(block)
> -                    classes_by_name[cls.name] = cls
> +                    parse_class(block)
>
>                  block = None
>              else:
>                  block.append((number, line))
>
> -    # write output files
> -    notice = "/* Generated by hyperv_wmi_generator.py */\n\n\n\n"
> -
> -    header.write(notice)
> -    source.write(notice)
> -    classes_typedef.write(notice)
> -    classes_header.write(notice)
> -    classes_source.write(notice)
> -
> -    names = classes_by_name.keys()
> +    names = wmi_classes_by_name.keys()
>      names.sort()
>
>      for name in names:
> -        header.write(classes_by_name[name].generate_header())
> -        source.write(classes_by_name[name].generate_source())
> -        classes_typedef.write(classes_by_name[name].generate_classes_typedef())
> -        classes_header.write(classes_by_name[name].generate_classes_header())
> -        classes_source.write(classes_by_name[name].generate_classes_source())
> +        cls = wmi_classes_by_name[name]
> +        cls.prepare()
> +
> +        classes_typedef.write(cls.generate_classes_typedef())
> +        classes_header.write(cls.generate_classes_header())
> +        classes_source.write(cls.generate_classes_source())

You're dropping the notice comment from the generated files. Is this
intentional?

-- 
Matthias Bolte
http://photron.blogspot.com

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux