Skip to content
Snippets Groups Projects
Commit 1e73806b authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fixed imports, horribly bumped the version

parent 1b42a692
No related branches found
No related tags found
No related merge requests found
# v2.1.12 # v2.2.1
* added [TerminableThread](satella/coding/concurrent/thread.py) * added [TerminableThread](satella/coding/concurrent/thread.py)
* **COMPATIBILITY BREAKERS**
* `Singleton` and family are meant to be imported from `satella.coding.structures`
* `CallableGroup` is meant to be imported from `satella.coding.concurrent`
# v2.1.11 # v2.1.11
......
...@@ -9,7 +9,7 @@ Heap ...@@ -9,7 +9,7 @@ Heap
This essentially allows you to have a heap object that will pretty much This essentially allows you to have a heap object that will pretty much
behave like the `heapq <https://docs.python.org/2/library/heapq.html>` library. behave like the `heapq <https://docs.python.org/2/library/heapq.html>` library.
.. autoclass:: satella.coding.Heap .. autoclass:: satella.coding.structures.Heap
:members: :members:
TimeBasedHeap TimeBasedHeap
...@@ -18,7 +18,7 @@ TimeBasedHeap ...@@ -18,7 +18,7 @@ TimeBasedHeap
Time-based heap is a good structure if you have many callbacks set to fire at a particular Time-based heap is a good structure if you have many callbacks set to fire at a particular
time in the future. It functions very like a normal Heap. time in the future. It functions very like a normal Heap.
.. autoclass:: satella.coding.TimeBasedHeap .. autoclass:: satella.coding.structures.TimeBasedHeap
:members: :members:
typednamedtuple typednamedtuple
...@@ -27,28 +27,23 @@ typednamedtuple ...@@ -27,28 +27,23 @@ typednamedtuple
It's a named tuple, but it has typed fields. You will get a TypeError if you It's a named tuple, but it has typed fields. You will get a TypeError if you
try to assign something else there. try to assign something else there.
.. autofunction:: satella.coding.typednamedtuple .. autofunction:: satella.coding.structures.typednamedtuple
OmniHashableMixin OmniHashableMixin
----------------- -----------------
If you need quick __hash__ and __eq__ operators from listed fields of the class. If you need quick __hash__ and __eq__ operators from listed fields of the class.
.. autoclass:: satella.coding.OmniHashableMixin .. autoclass:: satella.coding.structures.OmniHashableMixin
:members: :members:
.. autofunction:: satella.coding.typednamedtuple
Singleton Singleton
--------- ---------
Makes the resulting object's ``__init__()`` be called at most once, then caches the object and returns the same Makes the resulting object's ``__init__()`` be called at most once, then caches the object and returns the same
upon each instantiation. upon each instantiation.
.. autofunction:: satella.coding.Singleton .. autofunction:: satella.coding.structures.Singleton
DictObject DictObject
---------- ----------
...@@ -56,10 +51,10 @@ DictObject ...@@ -56,10 +51,10 @@ DictObject
DictObject is an object constructed out of a dict, that allows it's values to be obtained as getattr(), and not only DictObject is an object constructed out of a dict, that allows it's values to be obtained as getattr(), and not only
getitem(). getitem().
.. autoclass:: satella.coding.DictObject .. autoclass:: satella.coding.structures.DictObject
:members: :members:
You can use the following function to recursively turn every dict into a DictObject You can use the following function to recursively turn every dict into a DictObject
.. autofunction:: satella.coding.apply_dict_object .. autofunction:: satella.coding.structures.apply_dict_object
# coding=UTF-8 # coding=UTF-8
__version__ = '2.1.12rc1' __version__ = '2.2.1rc1'
...@@ -3,21 +3,16 @@ Just useful objects to make your coding nicer every day ...@@ -3,21 +3,16 @@ Just useful objects to make your coding nicer every day
""" """
from .algos import merge_dicts from .algos import merge_dicts
from .concurrent import Monitor, RMonitor, CallableGroup from .concurrent import Monitor, RMonitor
from .recast_exceptions import rethrow_as, silence_excs from .recast_exceptions import rethrow_as, silence_excs
from .structures import TimeBasedHeap, Heap, typednamedtuple, OmniHashableMixin, Singleton, \
DictObject, apply_dict_object
from .decorators import precondition, for_argument, PreconditionError from .decorators import precondition, for_argument, PreconditionError
from .fun_static import static_var from .fun_static import static_var
__all__ = [ __all__ = [
'typednamedtuple', 'OmniHashableMixin', 'Monitor', 'RMonitor', 'merge_dicts',
'TimeBasedHeap', 'Heap', 'CallableGroup', 'DictObject', 'apply_dict_object',
'Monitor', 'RMonitor', 'CallableGroup', 'merge_dicts',
'for_argument', 'for_argument',
'precondition', 'PreconditionError', 'precondition', 'PreconditionError',
'rethrow_as', 'silence_excs', 'rethrow_as', 'silence_excs',
'Singleton',
'static_var' 'static_var'
] ]
...@@ -3,8 +3,7 @@ from __future__ import print_function, absolute_import, division ...@@ -3,8 +3,7 @@ from __future__ import print_function, absolute_import, division
import unittest import unittest
import time import time
from satella.coding import CallableGroup from satella.coding.concurrent import TerminableThread, CallableGroup
from satella.coding.concurrent import TerminableThread
class TestCallableGroup(unittest.TestCase): class TestCallableGroup(unittest.TestCase):
......
import unittest import unittest
from satella.coding import LockedDataset from satella.coding.concurrent import LockedDataset
from satella.exceptions import ResourceLocked, ResourceNotLocked from satella.exceptions import ResourceLocked, ResourceNotLocked
......
...@@ -3,7 +3,7 @@ from __future__ import print_function, absolute_import, division ...@@ -3,7 +3,7 @@ from __future__ import print_function, absolute_import, division
import unittest import unittest
from satella.coding import Singleton from satella.coding.structures import Singleton
class TestSingleton(unittest.TestCase): class TestSingleton(unittest.TestCase):
......
...@@ -6,8 +6,9 @@ import unittest ...@@ -6,8 +6,9 @@ import unittest
import mock import mock
from satella.coding import TimeBasedHeap, Heap, CallableGroup, typednamedtuple, \ from satella.coding.structures import TimeBasedHeap, Heap, typednamedtuple, \
OmniHashableMixin, DictObject, apply_dict_object OmniHashableMixin, DictObject, apply_dict_object
from satella.coding.concurrent import CallableGroup
class TestCallableGroup(unittest.TestCase): class TestCallableGroup(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment