no more abstract methods
This commit is contained in:
parent
0a20cb5e41
commit
af053b9ac4
@ -1,8 +1,7 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Controller(ABC):
|
||||
class Controller(object):
|
||||
def __init__(self, handler, request, options):
|
||||
self.handler = handler
|
||||
self.request = request
|
||||
|
@ -1,10 +1,9 @@
|
||||
from . import Controller
|
||||
import pkg_resources
|
||||
from string import Template
|
||||
from abc import ABCMeta
|
||||
|
||||
|
||||
class TemplateController(Controller, metaclass=ABCMeta):
|
||||
class TemplateController(Controller):
|
||||
def render_template(self, file, **vars):
|
||||
file_content = pkg_resources.resource_string("htdocs", file).decode("utf-8")
|
||||
template = Template(file_content)
|
||||
@ -18,7 +17,7 @@ class TemplateController(Controller, metaclass=ABCMeta):
|
||||
return {}
|
||||
|
||||
|
||||
class WebpageController(TemplateController, metaclass=ABCMeta):
|
||||
class WebpageController(TemplateController):
|
||||
def template_variables(self):
|
||||
header = self.render_template("include/header.include.html")
|
||||
return {"header": header}
|
||||
|
Loading…
Reference in New Issue
Block a user