[gnome-builder] snippets: tweak python snippets



commit ceec1d89a9de1e8ff08867ef6218487bd693ec7f
Author: Christian Hergert <christian hergert me>
Date:   Sun Feb 21 15:08:38 2016 -0800

    snippets: tweak python snippets
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748221

 data/snippets/python.snippets |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/data/snippets/python.snippets b/data/snippets/python.snippets
index fc9ae8e..0a2ad78 100644
--- a/data/snippets/python.snippets
+++ b/data/snippets/python.snippets
@@ -15,21 +15,31 @@ snippet def
                $0
 snippet class
 - scope python, python3
-       class ${1:Foo}(${2:object}):
-               def __init__(self${3}):
-                       $0
+       class ${1:ClassName}(${2:object}):
+       
+               def __init__(self${3:,}):
+                       ${4:pass}
+       
+       $0
 snippet gobject
-- scope python, python3
-       class ${1:Foo}(${2:GObject.Object}):
-               __gtype_name__ = "$1"
+- scope python
+       class ${1:ClassName}(${2:GObject.Object}):
 
-               def __init__(self${3}):
+               def __init__(self${3:,}):
                        $2.__init__(self)
-                       $0
+       
+       $0
+- scope python3
+       class ${1:ClassName}(${2:GObject.Object}):
+
+               def __init__(self${3:,}):
+                       super().__init__()
+       
+       $0
 snippet gsignal
 - desc Entry in __gsignals__ dictionary
 - scope python, python3
-       "${1:signal}": (GObject.${2:SIGNAL_RUN_FIRST}, ${3:None}, (${4:int,}))$0
+       "${1:signal}": (GObject.SignalFlags.${2:RUN_FIRST}, ${3:None}, (${4:int,}))$0
 snippet gproperty
 - scope python, python3
-       ${1:foo} = GObject.property(type=${2:int}, default=${3:0})$0
+       ${1:foo} = GObject.Property(type=${2:int}, default=${3:0})$0


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