~jerith/entropy-store/arbitrary-object-id

« back to all changes in this revision

Viewing changes to entropy/web.py

  • Committer: Tristan Seligmann
  • Date: 2009-06-08 05:26:43 UTC
  • Revision ID: mithrandi@mithrandi.za.net-20090608052643-xi55lrco5k4io095
Add some tests for hashing and fix bugs in the error path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from zope.interface import implements
 
2
 
 
3
from axiom.item import Item
 
4
from axiom.attributes import path
 
5
 
 
6
from nevow.inevow import IResource
 
7
 
 
8
from xmantissa.ixmantissa import IProtocolFactoryFactory
 
9
from xmantissa.web import AxiomSite
 
10
 
 
11
from entropy.util import getAppStore
 
12
 
 
13
 
 
14
# FIXME: This is a blatant rip from Mantissa's code, necessary in order to
 
15
# customize the root of the site, to avoid having guard wrapped around it.
 
16
 
 
17
class SimpleSiteFactory(Item):
 
18
    """
 
19
    Configuration object for a Mantissa HTTP server.
 
20
    """
 
21
    powerupInterfaces = [IProtocolFactoryFactory]
 
22
    implements(*powerupInterfaces)
 
23
 
 
24
    httpLog = path(default=None)
 
25
 
 
26
    def getFactory(self):
 
27
        """
 
28
        Create an L{AxiomSite} which supports authenticated and anonymous
 
29
        access.
 
30
        """
 
31
        logPath = self.httpLog and self.httpLog.path
 
32
        appStore = getAppStore(self.store)
 
33
        return AxiomSite(appStore, IResource(appStore), logPath=logPath)