[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/26] qapi/pragma.py: Move QAPISchemaPragma into its own module
From: |
John Snow |
Subject: |
[PATCH 16/26] qapi/pragma.py: Move QAPISchemaPragma into its own module |
Date: |
Tue, 22 Sep 2020 18:35:15 -0400 |
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/pragma.py | 25 +++++++++++++++++++++++++
scripts/qapi/source.py | 15 ++-------------
2 files changed, 27 insertions(+), 13 deletions(-)
create mode 100644 scripts/qapi/pragma.py
diff --git a/scripts/qapi/pragma.py b/scripts/qapi/pragma.py
new file mode 100644
index 0000000000..7f3db9ab87
--- /dev/null
+++ b/scripts/qapi/pragma.py
@@ -0,0 +1,25 @@
+#
+# QAPI pragma information
+#
+# Copyright (c) 2020 John Snow, for Red Hat Inc.
+#
+# Authors:
+# John Snow <jsnow@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2.
+# See the COPYING file in the top-level directory.
+
+from typing import List
+
+
+class QAPISchemaPragma:
+ # Replace with @dataclass in Python 3.7+
+ # pylint: disable=too-few-public-methods
+
+ def __init__(self) -> None:
+ # Are documentation comments required?
+ self.doc_required = False
+ # Whitelist of commands allowed to return a non-dictionary
+ self.returns_whitelist: List[str] = []
+ # Whitelist of entities allowed to violate case conventions
+ self.name_case_whitelist: List[str] = []
diff --git a/scripts/qapi/source.py b/scripts/qapi/source.py
index d1de9e36b1..fe1424be03 100644
--- a/scripts/qapi/source.py
+++ b/scripts/qapi/source.py
@@ -11,20 +11,9 @@
import copy
import sys
-from typing import List, Optional, TypeVar
+from typing import Optional, TypeVar
-
-class QAPISchemaPragma:
- # Replace with @dataclass in Python 3.7+
- # pylint: disable=too-few-public-methods
-
- def __init__(self) -> None:
- # Are documentation comments required?
- self.doc_required = False
- # Whitelist of commands allowed to return a non-dictionary
- self.returns_whitelist: List[str] = []
- # Whitelist of entities allowed to violate case conventions
- self.name_case_whitelist: List[str] = []
+from .pragma import QAPISchemaPragma
class QAPISourceInfo:
--
2.26.2
- [PATCH 07/26] qapi/parser.py: fully remove 'null' constant, (continued)
- [PATCH 07/26] qapi/parser.py: fully remove 'null' constant, John Snow, 2020/09/22
- [PATCH 08/26] qapi/parser.py: Assert lexer value is a string, John Snow, 2020/09/22
- [PATCH 06/26] qapi/parser.py: raise QAPIParseError during file opening, John Snow, 2020/09/22
- [PATCH 09/26] qapi/parser.py: assert get_expr returns object in outer loop, John Snow, 2020/09/22
- [PATCH 10/26] qapi/parser.py: assert object keys are strings, John Snow, 2020/09/22
- [PATCH 11/26] qapi/parser.py: Convert several methods to @classmethod, John Snow, 2020/09/22
- [PATCH 12/26] qapi/parser.py: add casts to pragma checks, John Snow, 2020/09/22
- [PATCH 13/26] qapi/parser.py: add type hint annotations, John Snow, 2020/09/22
- [PATCH 14/26] qapi/parser.py: add docstrings, John Snow, 2020/09/22
- [PATCH 15/26] qapi/parser.py: add ParsedExpression type, John Snow, 2020/09/22
- [PATCH 16/26] qapi/pragma.py: Move QAPISchemaPragma into its own module,
John Snow <=
- [PATCH 18/26] qapi/parser.py: Modify _include() to use parser state, John Snow, 2020/09/22
- [PATCH 17/26] qapi/pragma.py: Move pragma parsing out of parser.py, John Snow, 2020/09/22
- [PATCH 20/26] qapi/parser.py: remove unused check_args_section arguments, John Snow, 2020/09/22
- [PATCH 21/26] qapi/parser.py: QAPIDoc: convert @staticmethod to @classmethod, John Snow, 2020/09/22
- [PATCH 19/26] qapi/parser.py: add parent argument, John Snow, 2020/09/22
- [PATCH 23/26] qapi/parser.py: enable mypy checks, John Snow, 2020/09/22
- [PATCH 24/26] qapi/parser.py: remove one and two-letter variables, John Snow, 2020/09/22
- [PATCH 25/26] qapi/parser.py: Silence too-few-public-methods warning, John Snow, 2020/09/22
- [PATCH 26/26] qapi/parser.py: enable pylint checks, John Snow, 2020/09/22
- [PATCH 22/26] qapi/parser.py: add type hint annotations (QAPIDoc), John Snow, 2020/09/22