Format using black

This commit is contained in:
James Westman 2022-12-19 11:49:10 -06:00
parent 6a36d92380
commit 8fee46ec68
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
40 changed files with 975 additions and 610 deletions

View file

@ -24,8 +24,12 @@ from .common import *
class GtkDirective(AstNode):
grammar = Statement(
Match("using").err("File must start with a \"using Gtk\" directive (e.g. `using Gtk 4.0;`)"),
Match("Gtk").err("File must start with a \"using Gtk\" directive (e.g. `using Gtk 4.0;`)"),
Match("using").err(
'File must start with a "using Gtk" directive (e.g. `using Gtk 4.0;`)'
),
Match("Gtk").err(
'File must start with a "using Gtk" directive (e.g. `using Gtk 4.0;`)'
),
UseNumberText("version").expected("a version number for GTK"),
)
@ -35,7 +39,9 @@ class GtkDirective(AstNode):
if version not in ["4.0"]:
err = CompileError("Only GTK 4 is supported")
if version and version.startswith("4"):
err.hint("Expected the GIR version, not an exact version number. Use 'using Gtk 4.0;'.")
err.hint(
"Expected the GIR version, not an exact version number. Use 'using Gtk 4.0;'."
)
else:
err.hint("Expected 'using Gtk 4.0;'")
raise err
@ -51,7 +57,6 @@ class GtkDirective(AstNode):
hints=e.hints,
)
@property
def gir_namespace(self):
# validate the GTK version first to make sure the more specific error