Fix mypy issues

This commit is contained in:
James Westman 2022-01-28 14:07:29 -06:00
parent 1150ae1a09
commit cb35acad17
3 changed files with 19 additions and 15 deletions

View file

@ -1,7 +1,8 @@
""" Contains all the syntax beyond basic objects, properties, signal, and
templates. """
from .gobject_object import Object
from .attributes import BaseAttribute, BaseTypedAttribute
from .gobject_object import Object, ObjectContent
from .gobject_property import Property
from .gobject_signal import Signal
from .gtk_a11y import A11y
@ -14,6 +15,7 @@ from .gtk_string_list import Strings
from .gtk_styles import Styles
from .gtkbuilder_child import Child
from .gtkbuilder_template import Template
from .imports import GtkDirective, Import
from .ui import UI
from .values import IdentValue, TranslatedStringValue, FlagsValue, LiteralValue

View file

@ -18,6 +18,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import typing as T
from .common import *
@ -41,11 +42,11 @@ class ObjectContent(AstNode):
x.emit_xml(xml)
class Object(AstNode):
grammar = Sequence(
grammar: T.Any = [
class_name,
Optional(UseIdent("id")),
ObjectContent,
)
]
@validate("namespace")
def gir_ns_exists(self):