[gnome-builder/wip/tingping/pygobject-template] meson-templates: Update Python template to use Gtk.Template



commit 425de982f1a6997a81849aae817cc64425015bdb
Author: Patrick Griffis <tingping tingping se>
Date:   Sat Jun 16 17:27:09 2018 -0400

    meson-templates: Update Python template to use Gtk.Template

 .../meson-templates/meson-templates.gresource.xml  |   1 -
 src/plugins/meson-templates/meson_templates.py     |   1 -
 .../meson-templates/resources/src/gi_composites.py | 273 ---------------------
 .../meson-templates/resources/src/meson-py.build   |   1 -
 .../meson-templates/resources/src/window.py        |   6 +-
 5 files changed, 2 insertions(+), 280 deletions(-)
---
diff --git a/src/plugins/meson-templates/meson-templates.gresource.xml 
b/src/plugins/meson-templates/meson-templates.gresource.xml
index f71945e91..fbe778768 100644
--- a/src/plugins/meson-templates/meson-templates.gresource.xml
+++ b/src/plugins/meson-templates/meson-templates.gresource.xml
@@ -14,7 +14,6 @@
     <file compressed="true">resources/src/__init__.py</file>
     <file compressed="true">resources/src/meson-c-vala.build</file>
     <file compressed="true">resources/src/meson-empty.build</file>
-    <file compressed="true">resources/src/gi_composites.py</file>
     <file compressed="true">resources/src/main.js.tmpl</file>
     <file compressed="true">resources/src/main.c</file>
     <file compressed="true">resources/src/main-cli.c</file>
diff --git a/src/plugins/meson-templates/meson_templates.py b/src/plugins/meson-templates/meson_templates.py
index 0b2764289..e9541e1cc 100644
--- a/src/plugins/meson-templates/meson_templates.py
+++ b/src/plugins/meson-templates/meson_templates.py
@@ -297,7 +297,6 @@ class GnomeProjectTemplate(MesonTemplate):
             meson_file = 'resources/src/meson-js.build'
         elif self.language == 'python':
             files['resources/src/hello.py.in'] = 'src/%(name)s.in'
-            files['resources/src/gi_composites.py'] = 'src/gi_composites.py'
             files['resources/src/__init__.py'] = 'src/__init__.py'
             files['resources/src/window.py'] = 'src/window.py'
             files['resources/src/main.py'] = 'src/main.py'
diff --git a/src/plugins/meson-templates/resources/src/meson-py.build 
b/src/plugins/meson-templates/resources/src/meson-py.build
index 07d652f69..8545d7674 100644
--- a/src/plugins/meson-templates/resources/src/meson-py.build
+++ b/src/plugins/meson-templates/resources/src/meson-py.build
@@ -27,7 +27,6 @@ configure_file(
 
 {{name_}}_sources = [
   '__init__.py',
-  'gi_composites.py',
   'main.py',
   'window.py',
 ]
diff --git a/src/plugins/meson-templates/resources/src/window.py 
b/src/plugins/meson-templates/resources/src/window.py
index 73d3a5dca..6a18be3f0 100644
--- a/src/plugins/meson-templates/resources/src/window.py
+++ b/src/plugins/meson-templates/resources/src/window.py
@@ -1,15 +1,13 @@
 {{include "license.py"}}
 
 from gi.repository import Gtk
-from .gi_composites import GtkTemplate
 
 
-@GtkTemplate(ui='{{appid_path}}/{{ui_file}}')
+@Gtk.Template(resource_path='{{appid_path}}/{{ui_file}}')
 class {{PreFix}}Window(Gtk.ApplicationWindow):
     __gtype_name__ = '{{PreFix}}Window'
 
-    label = GtkTemplate.Child()
+    label = Gtk.Template.Child()
 
     def __init__(self, **kwargs):
         super().__init__(**kwargs)
-        self.init_template()


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