Skip to content

Commit 6e3ac5e

Browse files
committed
Renamed context_managers to context_management
1 parent bb2d7c0 commit 6e3ac5e

34 files changed

+37
-37
lines changed

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ contains:
99
- `python_toolbox.cute_iter_tools`: Tools for manipulating iterables. Adds
1010
useful functions not found in Python's built-in `itertools`.
1111

12-
- `python_toolbox.context_managers`: Pimping up your context managers.
12+
- `python_toolbox.context_management`: Pimping up your context managers.
1313

1414
- `python_toolbox.emitters`: A publisher-subscriber framework that doesn't
1515
abuse strings.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
.. _topics-context-managers:
88

9-
:mod:`context_managers`
10-
=======================
9+
:mod:`context_management`
10+
=========================
1111

1212
Context managers are awesome
1313
----------------------------
@@ -34,7 +34,7 @@ The :class:`ContextManager` class allows using context managers as decorators
3434
new form called :meth:`manage_context`. (As well as the original forms).
3535
First let's import:
3636

37-
>>> from python_toolbox import context_managers
37+
>>> from python_toolbox import context_management
3838

3939
Now let's go over the features one by one.
4040

@@ -52,15 +52,15 @@ has their own advantages and disadvantages over the others.
5252
:meth:`__enter__` and :meth:`__exit__` methods. This is allowed, and if you
5353
do this you should still inherit from :class:`ContextManager`. Example:
5454

55-
>>> class MyContextManager(context_managers.ContextManager):
55+
>>> class MyContextManager(context_management.ContextManager):
5656
... def __enter__(self):
5757
... pass # preparation
5858
... def __exit__(self, type_=None, value=None, traceback=None):
5959
... pass # cleanup
6060

6161
- As a decorated generator, like so:
6262

63-
>>> @context_managers.ContextManagerType
63+
>>> @context_management.ContextManagerType
6464
... def MyContextManager():
6565
... # preparation
6666
... try:
@@ -74,7 +74,7 @@ has their own advantages and disadvantages over the others.
7474
This usage is nothing new; it's also available when using the standard
7575
library's :func:`contextlib.contextmanager` decorator. One thing that is
7676
allowed here that :mod:`contextlib` doesn't allow is to yield the context
77-
manager itself by doing ``yield context_managers.SelfHook``.
77+
manager itself by doing ``yield context_management.SelfHook``.
7878

7979
- The third and novel way is by defining a class with a :meth:`manage_context`
8080
method which returns a decorator. Example:
File renamed without changes.

python_toolbox/context_managers/base_classes/__init__.py renamed to python_toolbox/context_management/base_classes/__init__.py

File renamed without changes.

python_toolbox/context_managers/base_classes/decorating_context_manager.py renamed to python_toolbox/context_management/base_classes/decorating_context_manager.py

File renamed without changes.

python_toolbox/context_managers/blank_context_manager.py renamed to python_toolbox/context_management/blank_context_manager.py

File renamed without changes.
File renamed without changes.

python_toolbox/context_managers/context_manager_type.py renamed to python_toolbox/context_management/context_manager_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __is_the_base_context_manager_class(cls):
146146

147147
return (
148148
(cls.__name__ == 'ContextManager') and
149-
(cls.__module__ == 'python_toolbox.context_managers.'
149+
(cls.__module__ == 'python_toolbox.context_management.'
150150
'context_manager') and
151151
(cls.mro() == [cls, object])
152152
)

python_toolbox/context_managers/context_manager_type_type.py renamed to python_toolbox/context_management/context_manager_type_type.py

File renamed without changes.

python_toolbox/context_managers/delegating_context_manager.py renamed to python_toolbox/context_management/delegating_context_manager.py

File renamed without changes.

0 commit comments

Comments
 (0)