[pygobject] Don't use doctest syntax in docstrings for examples



commit ae3439f1d22482d6a920a869d3d17e7054af6f80
Author: Martin Pitt <martinpitt gnome org>
Date:   Wed Jul 3 10:40:28 2013 +0200

    Don't use doctest syntax in docstrings for examples
    
    These are not actual doctests, so don't use the >>> syntax there. Just indent
    them.
    
    This fixes pyflakes 0.7 failures.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701009

 gi/_gobject/propertyhelper.py |   11 +++++------
 gi/overrides/GObject.py       |    8 ++++----
 gi/overrides/Gtk.py           |    2 +-
 3 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/gi/_gobject/propertyhelper.py b/gi/_gobject/propertyhelper.py
index 41be81d..162d30a 100644
--- a/gi/_gobject/propertyhelper.py
+++ b/gi/_gobject/propertyhelper.py
@@ -48,14 +48,13 @@ class Property(object):
     Creates a new property which in conjunction with GObject subclass will
     create a property proxy:
 
-    >>> class MyObject(GObject.GObject):
-    >>> ... prop = GObject.Property(type=str)
+         class MyObject(GObject.GObject):
+         ... prop = GObject.Property(type=str)
 
-    >>> obj = MyObject()
-    >>> obj.prop = 'value'
+         obj = MyObject()
+         obj.prop = 'value'
 
-    >>> obj.prop
-    'value'
+         obj.prop  # now is 'value'
 
     The API is similar to the builtin property:
 
diff --git a/gi/overrides/GObject.py b/gi/overrides/GObject.py
index 42c97a2..aa9974e 100644
--- a/gi/overrides/GObject.py
+++ b/gi/overrides/GObject.py
@@ -448,8 +448,8 @@ def signal_handler_block(obj, handler_id):
     Returns a context manager which optionally can be used to
     automatically unblock the handler:
 
-    >>> with GObject.signal_handler_block(obj, id):
-    >>>    pass
+      with GObject.signal_handler_block(obj, id):
+         pass
     """
     GObjectModule.signal_handler_block(_get_instance_for_signal(obj), handler_id)
     return _HandlerBlockManager(obj, handler_id)
@@ -616,8 +616,8 @@ class Object(GObjectModule.Object):
         Returns a context manager which optionally can be used to
         automatically thaw notifications:
 
-        >>> with obj.freeze_notify():
-        >>>     pass
+          with obj.freeze_notify():
+              pass
         """
         super(Object, self).freeze_notify()
         return _FreezeNotifyManager(self)
diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 9a6e1a3..60bd757 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -473,7 +473,7 @@ class Dialog(Gtk.Dialog, Container):
         pairs - button text (or stock ID) and a response ID integer are passed
         individually. For example:
 
-        >>> dialog.add_buttons(Gtk.STOCK_OPEN, 42, "Close", Gtk.ResponseType.CLOSE)
+           dialog.add_buttons(Gtk.STOCK_OPEN, 42, "Close", Gtk.ResponseType.CLOSE)
 
         will add "Open" and "Close" buttons to dialog.
         """


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