Skip to content

Commit

Permalink
[pyqgis] comment some core additions
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 14, 2018
1 parent 81dabd1 commit 45e5b3f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions python/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ def __exit__(self, ex_type, ex_value, traceback):


class ReadWriteContextEnterCategory():
"""
Push a category to the stack
.. code-block:: python
context = QgsReadWriteContext()
with QgsReadWriteContext.enterCategory(context, category, details):
# do something
.. versionadded:: 3.2
"""

def __init__(self, context, category_name, details=None):
self.context = context
Expand Down Expand Up @@ -241,10 +252,11 @@ class ProjectDirtyBlocker():
"""
Context manager used to block project setDirty calls.
Example:
project = QgsProject.instance()
with QgsProject.blockDirtying(project):
# do something
.. code-block:: python
project = QgsProject.instance()
with QgsProject.blockDirtying(project):
# do something
.. versionadded:: 3.2
"""
Expand Down

0 comments on commit 45e5b3f

Please sign in to comment.