~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Matt Nordhoff
  • Date: 2010-05-05 18:52:14 UTC
  • mto: This revision was merged to the branch mainline in revision 416.
  • Revision ID: mnordhoff@mattnordhoff.com-20100505185214-7ysbsabjd138pjxj
NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
        logging.getLogger('simpleTAL').addHandler(handler)
70
70
        logging.getLogger('simpleTALES').addHandler(handler)
71
71
 
 
72
    def serve_http(transport, host=None, port=None, inet=None):
 
73
        from paste.httpexceptions import HTTPExceptionHandler
 
74
        from paste.httpserver import serve
72
75
 
73
 
    def _ensure_loggerhead_path():
74
 
        """Ensure that you can 'import loggerhead' and get the root."""
75
76
        # loggerhead internal code will try to 'import loggerhead', so
76
77
        # let's put it on the path if we can't find it in the existing path
77
78
        try:
80
81
            import os.path, sys
81
82
            sys.path.append(os.path.dirname(__file__))
82
83
 
83
 
    def serve_http(transport, host=None, port=None, inet=None):
84
 
        from paste.httpexceptions import HTTPExceptionHandler
85
 
        from paste.httpserver import serve
86
 
 
87
 
        _ensure_loggerhead_path()
88
 
 
89
84
        from loggerhead.apps.transport import BranchesFromTransportRoot
90
85
        from loggerhead.config import LoggerheadConfig
91
86
 
137
132
                    super(cmd_serve, self).run(*args, **kw)
138
133
 
139
134
        register_command(cmd_serve)
140
 
 
141
 
    def load_tests(standard_tests, module, loader):
142
 
        _ensure_loggerhead_path()
143
 
        standard_tests.addTests(loader.loadTestsFromModuleNames(
144
 
            ['bzrlib.plugins.loggerhead.loggerhead.tests']))
145
 
        return standard_tests