[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 03/38] qapi: move generator entrypoint into module
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH v2 03/38] qapi: move generator entrypoint into module |
Date: |
Tue, 22 Sep 2020 17:23:22 -0400 |
On Tue, Sep 22, 2020 at 05:00:26PM -0400, John Snow wrote:
> As part of delinting and adding type hints to the QAPI generator, it's
> helpful for the entrypoint to be part of the package, only leaving a
> very tiny entrypoint shim outside of the module.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> scripts/qapi-gen.py | 90 +++----------------------------------------
> scripts/qapi/main.py | 91 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 97 insertions(+), 84 deletions(-)
> create mode 100644 scripts/qapi/main.py
>
[...]
> diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py
> new file mode 100644
> index 0000000000..18c246bbb4
> --- /dev/null
> +++ b/scripts/qapi/main.py
> @@ -0,0 +1,91 @@
> +# This work is licensed under the terms of the GNU GPL, version 2 or later.
> +# See the COPYING file in the top-level directory.
> +
> +"""
> +QAPI Generator
> +
> +This is the main entry point for generating C code from the QAPI schema.
> +"""
> +
> +import argparse
> +import re
> +import sys
> +
> +from qapi.commands import gen_commands
> +from qapi.doc import gen_doc
> +from qapi.error import QAPIError
> +from qapi.events import gen_events
> +from qapi.introspect import gen_introspect
> +from qapi.schema import QAPISchema
> +from qapi.types import gen_types
> +from qapi.visit import gen_visit
Do you plan to change this to use relative imports eventually?
In either case:
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
--
Eduardo
- Re: [PATCH v2 10/38] qapi/common.py: delint with pylint, (continued)
- [PATCH v2 27/38] qapi/gen.py: Remove unused parameter, John Snow, 2020/09/22
- [PATCH v2 23/38] qapi/source.py: delint with pylint, John Snow, 2020/09/22
- [PATCH v2 11/38] qapi/common.py: Replace one-letter 'c' variable, John Snow, 2020/09/22
- [PATCH v2 03/38] qapi: move generator entrypoint into module, John Snow, 2020/09/22
- [PATCH v2 20/38] qapi/commands.py: add notational type hints, John Snow, 2020/09/22
- [PATCH v2 24/38] qapi/gen.py: Fix edge-case of _is_user_module, John Snow, 2020/09/22