[gnome-builder/ebassi/python-templates: 2/3] templates: Prefix the application class




commit d095ea4d4aa7c8e485bad2b461f6de3060038494
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Feb 28 20:09:38 2022 +0000

    templates: Prefix the application class
    
    We are prefixing the window class, we should do the same for the
    application class. This makes writing documentation slightly more
    easy.

 src/plugins/meson-templates/resources/src/main-gtk4.py | 4 ++--
 src/plugins/meson-templates/resources/src/main.py      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/meson-templates/resources/src/main-gtk4.py 
b/src/plugins/meson-templates/resources/src/main-gtk4.py
index cb4c62099..0184493ce 100755
--- a/src/plugins/meson-templates/resources/src/main-gtk4.py
+++ b/src/plugins/meson-templates/resources/src/main-gtk4.py
@@ -13,7 +13,7 @@ from gi.repository import Gtk, Gio{{if is_adwaita}}, Adw{{end}}
 from .window import {{PreFix}}Window, AboutDialog
 
 
-class Application({{if is_adwaita}}Adw{{else}}Gtk{{end}}.Application):
+class {{Prefix}}Application({{if is_adwaita}}Adw{{else}}Gtk{{end}}.Application):
     """The main application singleton class."""
 
     def __init__(self):
@@ -61,5 +61,5 @@ class Application({{if is_adwaita}}Adw{{else}}Gtk{{end}}.Application):
 
 def main(version):
     """The application's entry point."""
-    app = Application()
+    app = {{Prefix}}Application()
     return app.run(sys.argv)
diff --git a/src/plugins/meson-templates/resources/src/main.py 
b/src/plugins/meson-templates/resources/src/main.py
index 757a40058..fcc081449 100755
--- a/src/plugins/meson-templates/resources/src/main.py
+++ b/src/plugins/meson-templates/resources/src/main.py
@@ -10,7 +10,7 @@ from gi.repository import Gtk, Gio
 from .window import {{PreFix}}Window
 
 
-class Application(Gtk.Application):
+class {{Prefix}}Application(Gtk.Application):
     def __init__(self):
         super().__init__(application_id='{{appid}}',
                          flags=Gio.ApplicationFlags.FLAGS_NONE)
@@ -23,5 +23,5 @@ class Application(Gtk.Application):
 
 
 def main(version):
-    app = Application()
+    app = {{Prefix}}Application()
     return app.run(sys.argv)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]