Anonymous avatar Anonymous committed 5e26bea

docs, rename mako plugin to get it to work

Comments (0)

Files changed (8)

docs/build/api.rst

 API
 ===
 
-Dogpile
+Region
+======
+
+.. automodule:: dogpile.cache.region
+    :members:
+
+Backend API
+=============
+
+.. automodule:: dogpile.cache.api
+    :members:
+
+Backends
+==========
+
+.. automodule:: dogpile.cache.backends.dbm
+    :members:
+
+.. automodule:: dogpile.cache.backends.memcached
+    :members:
+
+
+Plugins
 ========
 
-.. automodule:: dogpile.dogpile
+.. automodule:: dogpile.cache.plugins.mako_cache
     :members:
-
-NameRegistry
-=============
-
-.. automodule:: dogpile.nameregistry
-    :members:
-
-Utilities
-==========
-
-.. automodule:: dogpile.readwrite_lock
-    :members:
-
-

docs/build/conf.py

 # absolute, like shown here.
 sys.path.insert(0, os.path.abspath('../../'))
 
-import dogpile
+import dogpile.cache
 
 # -- General configuration -----------------------------------------------------
 
 master_doc = 'index'
 
 # General information about the project.
-project = u'Dogpile'
+project = u'dogpile.cache'
 copyright = u'2011, Mike Bayer'
 
 # The version info for the project you're documenting, acts as replacement for
 # built documents.
 #
 # The short X.Y version.
-version = dogpile.__version__
+version = dogpile.cache.__version__
 # The full version, including alpha/beta/rc tags.
-release = dogpile.__version__
+release = dogpile.cache.__version__
 
 
 # The language for content autogenerated by Sphinx. Refer to documentation

docs/build/index.rst

 ==========================================
-Welcome to Dogpile.Cache's documentation!
+Welcome to dogpile.cache's documentation!
 ==========================================
 
 `dogpile.cache <http://bitbucket.org/zzzeek/dogpile.cache>`_ provides a simple 

docs/build/usage.rst

                     "dogpile.cache.dbm", 
                     expiration_time=360,
                     arguments={"filename":"file.dbm"}
-                )
+                ),
         "memcached":make_region(
                     "dogpile.cache.pylibmc", 
                     expiration_time=3600,

dogpile/cache/plugins/mako.py

-from mako.cache import CacheImpl
-
-class MakoPlugin(CacheImpl):
-    def __init__(self, cache):
-        super(MakoPlugin, self).__init__(cache)
-        try:
-            self.regions = self.cache.template.cache_args['regions']
-        except KeyError:
-            raise KeyError(
-                "'cache_regions' argument is required on the "
-                "Mako Lookup or Template object for usage "
-                "with the dogpile.cache plugin.")
-
-    def _get_region(self, **kw):
-        try:
-            region = kw['region']
-        except KeyError:
-            raise KeyError(
-                "'cache_region' argument must be specified with 'cache=True'"
-                "within templates for usage with the dogpile.cache plugin.")
-        try:
-            return self.regions[region]
-        except KeyError:
-            raise KeyError("No such region '%s'" % region)
-
-    def get_and_replace(self, key, creation_function, **kw):
-        return self._get_region(**kw).get_or_create(key, creation_function)
-
-    def put(self, key, value, **kw):
-        self._get_region(**kw).put(key, value)
- 
-    def get(self, key, **kw):
-        return self._get_region(**kw).get(key)
- 
-    def invalidate(self, key, **kw):
-        self._get_region(**kw).delete(key)

dogpile/cache/plugins/mako_cache.py

+from mako.cache import CacheImpl
+
+class MakoPlugin(CacheImpl):
+    def __init__(self, cache):
+        super(MakoPlugin, self).__init__(cache)
+        try:
+            self.regions = self.cache.template.cache_args['regions']
+        except KeyError:
+            raise KeyError(
+                "'cache_regions' argument is required on the "
+                "Mako Lookup or Template object for usage "
+                "with the dogpile.cache plugin.")
+
+    def _get_region(self, **kw):
+        try:
+            region = kw['region']
+        except KeyError:
+            raise KeyError(
+                "'cache_region' argument must be specified with 'cache=True'"
+                "within templates for usage with the dogpile.cache plugin.")
+        try:
+            return self.regions[region]
+        except KeyError:
+            raise KeyError("No such region '%s'" % region)
+
+    def get_and_replace(self, key, creation_function, **kw):
+        return self._get_region(**kw).get_or_create(key, creation_function)
+
+    def put(self, key, value, **kw):
+        self._get_region(**kw).put(key, value)
+ 
+    def get(self, key, **kw):
+        return self._get_region(**kw).get(key)
+ 
+    def invalidate(self, key, **kw):
+        self._get_region(**kw).delete(key)

dogpile/cache/util.py

-import sha1
+from hashlib import sha1
 import inspect
 
 class PluginLoader(object):
 [egg_info]
 tag_build = dev
 
+[upload_docs]
+upload-dir = docs/build/output/html
+
 [nosetests]
 logging-config=nose_logging_config.ini
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.