mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Remove unused imports and code
This commit is contained in:
parent
10806bce1e
commit
a9f6bf8d89
15 changed files with 12 additions and 35 deletions
|
@ -1,6 +1,6 @@
|
|||
from .gtk_list_item_factory import ExtListItemFactory
|
||||
from .adw_message_dialog import ExtAdwMessageDialog
|
||||
from .attributes import BaseAttribute, BaseTypedAttribute
|
||||
from .attributes import BaseAttribute
|
||||
from .binding import Binding
|
||||
from .contexts import ValueTypeCtx
|
||||
from .expression import (
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .values import Value, Translated
|
||||
from .common import *
|
||||
|
||||
|
||||
|
@ -31,8 +30,3 @@ class BaseAttribute(AstNode):
|
|||
@property
|
||||
def name(self):
|
||||
return self.tokens["name"]
|
||||
|
||||
|
||||
class BaseTypedAttribute(BaseAttribute):
|
||||
"""A BaseAttribute whose parent has a value_type property that can assist
|
||||
in validation."""
|
||||
|
|
|
@ -21,7 +21,6 @@ from dataclasses import dataclass
|
|||
|
||||
from .common import *
|
||||
from .expression import Expression, LookupOp, LiteralExpr
|
||||
from .contexts import ValueTypeCtx
|
||||
|
||||
|
||||
class Binding(AstNode):
|
||||
|
|
|
@ -17,10 +17,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from .expression import Expression
|
||||
from .gobject_object import Object
|
||||
from .gtkbuilder_template import Template
|
||||
from .values import Value, ObjectValue
|
||||
from .common import *
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .attributes import BaseTypedAttribute
|
||||
from .attributes import BaseAttribute
|
||||
from .values import Value
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
from ..decompiler import escape_quote
|
||||
|
||||
|
||||
def get_property_types(gir):
|
||||
|
@ -105,7 +106,7 @@ def _get_docs(gir, name):
|
|||
return gir_type.doc
|
||||
|
||||
|
||||
class A11yProperty(BaseTypedAttribute):
|
||||
class A11yProperty(BaseAttribute):
|
||||
grammar = Statement(
|
||||
UseIdent("name"),
|
||||
":",
|
||||
|
@ -208,7 +209,7 @@ def decompile_relation(ctx, gir, name, cdata):
|
|||
@decompiler("state", cdata=True)
|
||||
def decompile_state(ctx, gir, name, cdata, translatable="false"):
|
||||
if decompile.truthy(translatable):
|
||||
ctx.print(f'{name}: _("{_escape_quote(cdata)}");')
|
||||
ctx.print(f'{name}: _("{escape_quote(cdata)}");')
|
||||
else:
|
||||
ctx.print_attribute(name, cdata, get_types(ctx.gir).get(name))
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .attributes import BaseTypedAttribute
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .attributes import BaseAttribute
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .common import *
|
||||
from .contexts import ValueTypeCtx
|
||||
|
|
|
@ -21,10 +21,7 @@ import typing as T
|
|||
|
||||
from blueprintcompiler.language.values import StringValue
|
||||
|
||||
from .attributes import BaseAttribute
|
||||
from .gobject_object import Object, ObjectContent
|
||||
from .common import *
|
||||
from .values import Translated, QuotedLiteral
|
||||
from .contexts import ValueTypeCtx
|
||||
|
||||
|
||||
|
@ -51,14 +48,6 @@ class Menu(AstNode):
|
|||
raise CompileError("Menu requires an ID")
|
||||
|
||||
|
||||
class MenuValue(AstNode):
|
||||
grammar = AnyOf(QuotedLiteral, Translated)
|
||||
|
||||
@property
|
||||
def child(self) -> T.Union[QuotedLiteral, Translated]:
|
||||
return self.children[0]
|
||||
|
||||
|
||||
class MenuAttribute(AstNode):
|
||||
tag_name = "attribute"
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
from .attributes import BaseTypedAttribute
|
||||
from .gobject_object import ObjectContent, validate_parent_type
|
||||
from .values import StringValue
|
||||
from .common import *
|
||||
|
|
|
@ -25,6 +25,10 @@ from .common import *
|
|||
class StyleClass(AstNode):
|
||||
grammar = UseQuoted("name")
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self.tokens["name"]
|
||||
|
||||
|
||||
class ExtStyles(AstNode):
|
||||
grammar = [
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
from .common import *
|
||||
from .contexts import ScopeCtx
|
||||
from .gobject_object import Object
|
||||
from .gtkbuilder_template import Template
|
||||
|
||||
|
||||
class PropertyBindingFlag(AstNode):
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
|
||||
import typing as T
|
||||
from .common import *
|
||||
from ..gir import Class, ExternType, Interface
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ import typing as T
|
|||
|
||||
from .common import *
|
||||
from .types import TypeName
|
||||
from .property_binding import PropertyBinding
|
||||
from .binding import Binding
|
||||
from .gobject_object import Object
|
||||
from .contexts import ScopeCtx, ValueTypeCtx
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue