put init params in class docs

This commit is contained in:
Mike Bayer 2011-11-17 14:22:03 -05:00
parent e3f1bcfdc9
commit fbcafdcc1b
3 changed files with 13 additions and 14 deletions

4
docs/build/conf.py vendored
View File

@ -22,7 +22,6 @@ import sys, os
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('.'))
import dogpile
@ -30,7 +29,7 @@ import dogpile
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'builder']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -95,7 +94,6 @@ pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
autodoc_default_flags = 'special-members'
# -- Options for HTML output ---------------------------------------------------

View File

@ -21,17 +21,17 @@ class Dogpile(object):
thread/process to be elected as the creator of a new value,
while other threads/processes continue to return the previous version
of that value.
:param expiretime: Expiration time in seconds.
:param init: if True, set the 'createdtime' to the
current time.
:param lock: a mutex object that provides
``acquire()`` and ``release()`` methods.
"""
def __init__(self, expiretime, init=False, lock=None):
"""Construct a new :class:`.Dogpile`.
:param expiretime: Expiration time in seconds.
:param init: if True, set the 'createdtime' to the
current time.
:param lock: a mutex object that provides
``acquire()`` and ``release()`` methods.
"""
if lock:
self.dogpilelock = lock

View File

@ -39,7 +39,11 @@ class NameRegistry(object):
all threads requesting a certain key use the same
:class:`.Dogpile` object, without the need to maintain
each :class:`.Dogpile` object persistently in memory.
:param creator: A function that will create a new
value, given the identifier passed to the :meth:`.NameRegistry.get`
method.
"""
_locks = weakref.WeakValueDictionary()
_mutex = threading.RLock()
@ -47,9 +51,6 @@ class NameRegistry(object):
def __init__(self, creator):
"""Create a new :class:`.NameRegistry`.
:param creator: A function that will create a new
value, given the identifier passed to the :meth:`.NameRegistry.get`
method.
"""
self._values = weakref.WeakValueDictionary()