Mercurial > genshi > genshi-test
comparison genshi/template/plugin.py @ 935:705727288d7e
Merge r1143 from 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 | Fri, 18 Mar 2011 09:17:52 +0000 |
parents | fbe34d12acde |
children |
comparison
equal
deleted
inserted
replaced
934:7c9ec79caedc | 935:705727288d7e |
---|---|
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] |