26 lines
603 B
Python
26 lines
603 B
Python
from milla.dispatch import routing
|
|
from . import gallery
|
|
import os
|
|
import milla.util
|
|
|
|
|
|
class Application(milla.Application):
|
|
|
|
def __init__(self, config=None):
|
|
self.config = {}
|
|
if config and os.access(config, os.R_OK):
|
|
self.config.update(milla.util.read_config(config))
|
|
self.config['milla.favicon'] = False
|
|
|
|
self.setup_routes()
|
|
|
|
@classmethod
|
|
def create(cls, config=None):
|
|
app = cls(config)
|
|
return app
|
|
|
|
def setup_routes(self):
|
|
self.dispatcher = r = routing.Router()
|
|
|
|
r.add_route('/', gallery.GalleryController())
|