[libpeas] Use Property instead of property as it is deprecated in PyGObject



commit cbe30d8b89995d24010c51739ed5b1d5c096f82e
Author: Garrett Regier <garrettregier gmail com>
Date:   Sat Mar 14 11:17:55 2015 -0700

    Use Property instead of property as it is deprecated in PyGObject

 peas-demo/plugins/pythonhello/pythonhello.py       |    2 +-
 .../plugins/extension-python/extension-py.py.in    |   10 +++-------
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/peas-demo/plugins/pythonhello/pythonhello.py b/peas-demo/plugins/pythonhello/pythonhello.py
index 2608284..bf832b3 100644
--- a/peas-demo/plugins/pythonhello/pythonhello.py
+++ b/peas-demo/plugins/pythonhello/pythonhello.py
@@ -29,7 +29,7 @@ LABEL_STRING="Python Says Hello!"
 class PythonHelloPlugin(GObject.Object, Peas.Activatable):
     __gtype_name__ = 'PythonHelloPlugin'
 
-    object = GObject.property(type=GObject.Object)
+    object = GObject.Property(type=GObject.Object)
 
     def do_activate(self):
         window = self.object
diff --git a/tests/libpeas/plugins/extension-python/extension-py.py.in 
b/tests/libpeas/plugins/extension-python/extension-py.py.in
index e3ecb60..728b399 100644
--- a/tests/libpeas/plugins/extension-python/extension-py.py.in
+++ b/tests/libpeas/plugins/extension-python/extension-py.py.in
@@ -31,15 +31,11 @@ class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
                             Introspection.Base, Introspection.Callable,
                             Introspection.HasPrerequisite):
 
-    object = GObject.property(type=GObject.Object)
-
-    @GObject.property(type=int)
-    def update_count(self):
-        return self.__update_count
+    object = GObject.Property(type=GObject.Object)
+    update_count = GObject.Property(type=int, default=0, minimum=0)
 
     def __init__(self):
         self.__lock = threading.Lock()
-        self.__update_count = 0
 
     def do_activate(self):
         pass
@@ -49,7 +45,7 @@ class ExtensionPythonPlugin(GObject.Object, Peas.Activatable,
 
     def do_update_state(self):
         with self.__lock:
-            self.__update_count += 1
+            self.update_count += 1
 
     def do_get_plugin_info(self):
         return self.plugin_info


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