Skip to content

Commit

Permalink
get rid of deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
t-8ch committed Jan 25, 2021
1 parent 7679401 commit 7fb6967
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions oscad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from .subscribers import locale_negotiator
from .util import load_themes, htmlize
from ._scss import renderer_factory
from ._scss import ScssRenderer
from . import version

__version__ = version.__version__
Expand Down Expand Up @@ -114,7 +114,7 @@ def main(global_config, **settings):
config.add_request_method(piwik, property=True)
config.add_request_method(oslic_chapter_url)

config.add_renderer('scss', renderer_factory)
config.add_renderer('scss', ScssRenderer)

config.set_locale_negotiator(locale_negotiator)
config.set_session_factory(SignedCookieSessionFactory(''))
Expand Down
11 changes: 3 additions & 8 deletions oscad/_scss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from zope.interface import implementer

from pyramid.interfaces import ITemplateRenderer
from pyramid.interfaces import IRendererFactory, IRenderer
from pyramid.asset import resolve_asset_spec
from pyramid.view import view_config

Expand Down Expand Up @@ -111,10 +111,6 @@ def handle_import(self, name, compilation, rule):
)


def renderer_factory(info):
return ScssRenderer(info, {})


class OscadScssCompiler(object):
def __init__(self, asset_path):
self._compiler = Compiler(extensions=[OscadScssExtension(asset_path),
Expand All @@ -129,14 +125,13 @@ def compile_from_path(self, filename, icon_font_path):
filename))


@implementer(ITemplateRenderer)
@implementer(IRendererFactory, IRenderer)
class ScssRenderer(object):
cache = None

def __init__(self, info, options):
def __init__(self, info):
self.cache = {}
self.info = info
self.options = options
asset_path = self.info.settings['scss.asset_path'].split()
self.compiler = OscadScssCompiler(asset_path)

Expand Down

0 comments on commit 7fb6967

Please sign in to comment.