# HG changeset patch # User k0s # Date 1261881660 18000 # Node ID cf77bd13aad9a79c77348ca29669f1b44e3c0494 # Parent 4efeb3ecab7a34703d8cef4e9fca70b55b4b2384 add support for headers diff -r 4efeb3ecab7a -r cf77bd13aad9 bitsyblog/bitsyblog.py --- a/bitsyblog/bitsyblog.py Sat Dec 26 13:08:48 2009 -0500 +++ b/bitsyblog/bitsyblog.py Sat Dec 26 21:41:00 2009 -0500 @@ -31,7 +31,6 @@ from docutils.utils import SystemMessage from genshi.builder import Markup from genshi.template import TemplateLoader -#from lxml import etree from pkg_resources import resource_filename from urlparse import urlparse from user import FilespaceUsers @@ -53,6 +52,7 @@ 'subject': '[ %(date)s ]:', 'n_links': 5, # number of links for navigation 'site_name': 'bitsyblog', + 'header': None, 'auto_reload': 'True', 'help_file': None, } @@ -78,8 +78,6 @@ self.loader = TemplateLoader(resource_filename(__name__, 'templates'), auto_reload=self.auto_reload.lower()=='true') - # static file renderer - # helpfile if self.help_file and os.path.exists(self.help_file): help = file(self.help_file).read() @@ -87,6 +85,10 @@ writer_name='html', settings_overrides={'report_level': 5}) + # header + if self.header: + self.header = Markup(self.header) + # for BitsyAuth self.newuser = self.users.new @@ -100,6 +102,7 @@ 'request': request, 'link': self.link, 'logo': self.logo(request), + 'header': self.header, 'user_url': self.user_url, 'permalink': self.permalink } diff -r 4efeb3ecab7a -r cf77bd13aad9 bitsyblog/factory.py --- a/bitsyblog/factory.py Sat Dec 26 13:08:48 2009 -0500 +++ b/bitsyblog/factory.py Sat Dec 26 21:41:00 2009 -0500 @@ -17,7 +17,7 @@ def bitsierfactory(global_conf, **app_conf): """make single-user bitsyblog""" - config = [ 'file_dir', 'date_format', 'subject', 'n_links', 'help_file' ] + config = [ 'file_dir', 'date_format', 'subject', 'n_links', 'help_file', 'header' ] key_str = 'bitsyblog.%s' args = dict([ (key, app_conf[ key_str % key]) for key in config if app_conf.has_key(key_str % key) ]) diff -r 4efeb3ecab7a -r cf77bd13aad9 bitsyblog/templates/navigation.html --- a/bitsyblog/templates/navigation.html Sat Dec 26 13:08:48 2009 -0500 +++ b/bitsyblog/templates/navigation.html Sat Dec 26 21:41:00 2009 -0500 @@ -6,6 +6,8 @@ xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="True"> + ${header} +