<s> """<STR_LIT>""" <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> from django . conf import settings <EOL> from django . db import models <EOL> from lino . utils import AttrDict <EOL> from lino . api import dd <EOL> from lino . utils . restify import restify <EOL> from lino . utils . restify import doc2rst <EOL> DUMMY_PAGES = { } <EOL> @ dd . python_2_unicode_compatible <EOL> class DummyPage ( AttrDict ) : <EOL> raw_html = False <EOL> def __str__ ( self ) : <EOL> return u'<STR_LIT>' % ( self . _meta . verbose_name , self . ref ) <EOL> def get_sidebar_html ( self , request ) : <EOL> return '<STR_LIT>' <EOL> def full_clean ( self ) : <EOL> pass <EOL> def save ( self ) : <EOL> pass <EOL> def create_page ( ** kw ) : <EOL> obj = DummyPage ( ** kw ) <EOL> DUMMY_PAGES [ obj . ref ] = obj <EOL> return obj <EOL> def lookup ( ref , default = models . NOT_PROVIDED ) : <EOL> if default is models . NOT_PROVIDED : <EOL> return DUMMY_PAGES [ ref ] <EOL> return DUMMY_PAGES . get ( ref , default ) <EOL> def render_node ( request , node , template_name = '<STR_LIT>' , ** context ) : <EOL> context . update ( node = node ) <EOL> heading = dd . babelattr ( node , '<STR_LIT:title>' , '<STR_LIT>' ) <EOL> if settings . SITE . title is None : <EOL> title = settings . SITE . verbose_name <EOL> else : <EOL> title = settings . SITE . title <EOL> if heading : <EOL> context . update ( heading = heading ) <EOL> context . update ( title = heading + '<STR_LIT>' + title ) <EOL> else : <EOL> context . update ( heading = title ) <EOL> context . update ( title = title ) <EOL> body = dd . babelattr ( node , '<STR_LIT:body>' , '<STR_LIT>' ) <EOL> if not node . raw_html : <EOL> body = restify ( doc2rst ( body ) ) <EOL> context . update ( body = body ) <EOL> return dd . plugins . jinja . render_from_request ( <EOL> request , template_name , ** context ) <EOL> def get_all_pages ( ) : <EOL> return list ( DUMMY_PAGES . values ( ) ) <EOL> if not settings . SITE . is_installed ( '<STR_LIT>' ) : <EOL> from lino . modlib . pages . fixtures import std <EOL> for o in std . objects ( ) : <EOL> pass </s>
