[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/cache/ Update doc
strings to ReST
Phil Ruggera
pruggera at san.rr.com
Sun Jul 18 23:25:41 EDT 2004
Log message for revision 26617:
Update doc strings to ReST
Changed:
U Zope3/trunk/src/zope/app/cache/annotationcacheable.py
U Zope3/trunk/src/zope/app/cache/browser/cacheable.py
U Zope3/trunk/src/zope/app/cache/browser/ram.py
U Zope3/trunk/src/zope/app/cache/caching.py
U Zope3/trunk/src/zope/app/cache/interfaces/__init__.py
U Zope3/trunk/src/zope/app/cache/interfaces/ram.py
U Zope3/trunk/src/zope/app/cache/ram.py
-=-
Modified: Zope3/trunk/src/zope/app/cache/annotationcacheable.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/annotationcacheable.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/annotationcacheable.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.interface import implements
from zope.proxy import removeAllProxies
Modified: Zope3/trunk/src/zope/app/cache/browser/cacheable.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/browser/cacheable.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/browser/cacheable.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.app import zapi
from zope.app.cache.caching import getCacheForObject, getLocationForCache
from zope.app.form.utility import setUpEditWidgets
Modified: Zope3/trunk/src/zope/app/cache/browser/ram.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/browser/ram.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/browser/ram.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.app.publisher.browser import BrowserView
from zope.app.cache.interfaces.ram import IRAMCache
Modified: Zope3/trunk/src/zope/app/cache/caching.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/caching.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/caching.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,12 +15,14 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.app import zapi
from zope.app.cache.interfaces import ICacheable, ICache
from zope.component import ComponentLookupError
def getCacheForObject(obj):
- """Returns the cache associated with obj or None."""
+ """Returns the cache associated with `obj` or ``None``."""
adapter = ICacheable(obj, None)
if adapter is None:
return None
@@ -30,7 +32,7 @@
return zapi.getUtility(ICache, cache_id)
def getLocationForCache(obj):
- """Returns the location to be used for caching the object or None."""
+ """Returns the location to be used for caching the object or ``None``."""
try:
return zapi.getPath(obj)
except (ComponentLookupError, TypeError):
Modified: Zope3/trunk/src/zope/app/cache/interfaces/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/interfaces/__init__.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/interfaces/__init__.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.interface import Interface
from zope.schema import Choice
@@ -40,7 +42,7 @@
def invalidate(ob, key=None):
"""Invalidates cached entries that apply to the given object.
- ob is an object location. If key is specified, only
+ `ob` is an object location. If `key` is specified, only
invalidates entry for the given key. Otherwise invalidates
all entries for the object.
"""
@@ -49,9 +51,9 @@
"""Invalidates all cached entries."""
def query(ob, key=None, default=None):
- """Returns the cached data previously stored by set().
+ """Returns the cached data previously stored by `set()`.
- ob is the location of the content object being cached. key is
+ `ob` is the location of the content object being cached. `key` is
a mapping of keywords and values which should all be used to
select a cache entry.
"""
Modified: Zope3/trunk/src/zope/app/cache/interfaces/ram.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/interfaces/ram.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/interfaces/ram.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from zope.interface import Attribute
from zope.app.cache.interfaces import ICache
@@ -36,7 +38,7 @@
The returned value is a sequence of dictionaries with the
following keys:
- 'path', 'hits', 'misses', 'size', 'entries'
+ `path`, `hits`, `misses`, `size`, `entries`
"""
def update(maxEntries, maxAge, cleanupInterval):
Modified: Zope3/trunk/src/zope/app/cache/ram.py
===================================================================
--- Zope3/trunk/src/zope/app/cache/ram.py 2004-07-19 03:14:30 UTC (rev 26616)
+++ Zope3/trunk/src/zope/app/cache/ram.py 2004-07-19 03:25:41 UTC (rev 26617)
@@ -15,6 +15,8 @@
$Id$
"""
+__docformat__ = 'restructuredtext'
+
from time import time
from thread import allocate_lock
from pickle import dumps
@@ -41,15 +43,15 @@
The design of this class is heavily based on RAMCacheManager in
Zope2.
- The idea behind the RAMCache is that it should be shared between
+ The idea behind the `RAMCache` is that it should be shared between
threads, so that the same objects are not cached in each thread.
This is achieved by storing the cache data structure itself as a
- module level variable (RAMCache.caches). This, of course,
+ module level variable (`RAMCache.caches`). This, of course,
requires locking on modifications of that data structure.
- RAMCache is a persistent object. The actual data storage is a
+ `RAMCache` is a persistent object. The actual data storage is a
volatile object, which can be acquired/created by calling
- _getStorage(). Storage objects are shared between threads and
+ ``_getStorage()``. Storage objects are shared between threads and
handle their blocking internally.
"""
@@ -152,7 +154,7 @@
entries.
This object is shared between threads. It corresponds to a single
- persistent RAMCache object. Storage does the locking necessary
+ persistent `RAMCache` object. Storage does the locking necessary
for thread safety.
"""
@@ -170,7 +172,7 @@
def update(self, maxEntries=None, maxAge=None, cleanupInterval=None):
"""Set the registration options.
- None values are ignored.
+ ``None`` values are ignored.
"""
if maxEntries is not None:
self.maxEntries = maxEntries
@@ -216,7 +218,7 @@
def _do_invalidate(self, ob, key=None):
"""This does the actual invalidation, but does not handle the locking.
- This method is supposed to be called from invalidate()
+ This method is supposed to be called from `invalidate`
"""
try:
if key is None:
@@ -264,7 +266,7 @@
self.writelock.release()
def removeStaleEntries(self):
- "Remove the entries older than maxAge"
+ "Remove the entries older than `maxAge`"
if self.maxAge > 0:
punchline = time() - self.maxAge
More information about the Zope3-Checkins
mailing list