Exemplo n.º 1
0
    def initialize(self, config):
        """Stores the supplied config object for later use

        args:
            config: A hooky.config.base.BaseConfig conforming object
        """
        log.debug('%s initialized %s with %s' % (self.__class__, self, config))
        self.config = config
        self.loader = template.Loader('%s/templates' %
                                      utils.getStaticPath())
Exemplo n.º 2
0
def getApplication(config):
    # Default list of URLs provided by Hooky and links to their classes
    URLS = [
        # Handle initial web clients at the root of our service.
        (r"/", root.RootHandler),

        # Provide access to our static content
        (r'/static/(.*)',
         web.StaticFileHandler,
         {'path': utils.getStaticPath()}),

        # Handle incoming hook requests
        (r"/hook", hook.HookRootHandler, {'config': config}),
        (r"/hook/(.*)", hook.HookHandler, {'config': config}),
    ]
    application = web.Application(URLS)
    return application
Exemplo n.º 3
0
 def initialize(self):
     """Log the initialization of this root handler"""
     self.loader = template.Loader('%s/templates' %
                                   utils.getStaticPath())
Exemplo n.º 4
0
 def testGetStaticPath(self):
     """Test the getStaticPath() method"""
     path = utils.getStaticPath()
     self.assertTrue(os.path.exists(path))
     self.assertTrue(os.path.exists(path))