comparison genshi/template/plugin.py @ 918:006b0fa6991c experimental-py3k

add support for python 3 to remaining genshi.template components: * minor changes to track encoding=None API change in core genshi modules. * genshi/template/directives: * slightly odd syntax changes to make the 2to3 .next() fixer pick up *stream.next() * minor test fix for change in behaviour of division (/) in Python 3. * genshi/template/loader: * add 'b' to file modes to ensure it's loaded as bytes in Python 3. * use not isinstance(s, unicode) instead of isinstance(s, str) since the former is correctly converted by 2to3.
author hodgestar
date Sun, 24 Oct 2010 22:48:15 +0000
parents fbe34d12acde
children
comparison
equal deleted inserted replaced
917:bcaa91c42b97 918:006b0fa6991c
42 self.get_extra_vars = extra_vars_func 42 self.get_extra_vars = extra_vars_func
43 if options is None: 43 if options is None:
44 options = {} 44 options = {}
45 self.options = options 45 self.options = options
46 46
47 self.default_encoding = options.get('genshi.default_encoding', 'utf-8') 47 self.default_encoding = options.get('genshi.default_encoding', None)
48 auto_reload = options.get('genshi.auto_reload', '1') 48 auto_reload = options.get('genshi.auto_reload', '1')
49 if isinstance(auto_reload, basestring): 49 if isinstance(auto_reload, basestring):
50 auto_reload = auto_reload.lower() in ('1', 'on', 'yes', 'true') 50 auto_reload = auto_reload.lower() in ('1', 'on', 'yes', 'true')
51 search_path = [p for p in 51 search_path = [p for p in
52 options.get('genshi.search_path', '').split(':') if p] 52 options.get('genshi.search_path', '').split(':') if p]
Copyright (C) 2012-2017 Edgewall Software