/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead.wsgi

  • Committer: Colin Watson
  • Date: 2022-08-08 16:33:50 UTC
  • mto: This revision was merged to the branch mainline in revision 528.
  • Revision ID: cjwatson@canonical.com-20220808163350-xd8ilh0u5m1kiylb
Port from SimpleTAL to Chameleon.

SimpleTAL is a painful dependency, because it has no download files on
PyPI: the only way to depend on it properly is therefore using a direct
URL reference, and as I understand it packages with such references
those can't be uploaded to PyPI.

Porting to Chameleon (Zope's default TAL implementation nowadays) turns
out not to be too difficult.  The main work involved is because it
doesn't support path expressions.  It would be possible to add those
using `z3c.pt`, and I considered that, but that has a significant
dependency tree for packages that don't already use the Zope Toolkit,
and it would have also required extra startup complexity to register
`ITraversable` adapters.  It's easier to convert path expressions to the
equivalent Python expressions, although the process of doing so was
unfortunately quite error-prone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335  USA
15
15
 
16
16
 
 
17
import sys
17
18
import os
18
19
import pwd
19
 
import sys
20
 
 
21
20
sys.path.insert(0, os.path.dirname(__file__))
22
21
 
23
 
from breezy import config as bzrconfig
24
 
from breezy.plugin import load_plugins
25
 
from paste.deploy.config import PrefixMiddleware
26
22
from paste.httpexceptions import HTTPExceptionHandler
27
 
 
 
23
from loggerhead.apps.transport import BranchesFromTransportRoot
28
24
from loggerhead.apps.error import ErrorHandlerApp
29
 
from loggerhead.apps.transport import BranchesFromTransportRoot
30
25
from loggerhead.config import LoggerheadConfig
31
 
 
 
26
from breezy import config as bzrconfig
 
27
from paste.deploy.config import PrefixMiddleware
 
28
from breezy.plugin import load_plugins
32
29
 
33
30
class NotConfiguredError(Exception):
34
31
    pass