themoken/Canto — Issue #27: case sensitivity highlighting error
Author: numbchild
Created: 2012-02-27 18:56:08+00:00
State: open

in conf.py:
r = get_default_renderer()
add_hook_pre_reader(r, highlight_word("NASA", None))

Invalid line in config.
Traceback (most recent call last):
File "/usr/lib/canto/canto/cfg/base.py", line 146, in parse
exec(data.encode("UTF-8"), {}, self.locals)
File "", line 587, in
File "/usr/lib/canto/canto/extra.py", line 321, in highlight_word
reg = re.compile(r"\b(" + re.escape(word) + r")\b", flags)
File "/usr/lib/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.7/re.py", line 242, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python2.7/sre_compile.py", line 500, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python2.7/sre_parse.py", line 673, in parse
p = _parse_sub(source, pattern, 0)
File "/usr/lib/python2.7/sre_parse.py", line 308, in _parse_sub
itemsappend(_parse(source, state))
File "/usr/lib/python2.7/sre_parse.py", line 401, in _parse
if state.flags & SRE_FLAG_VERBOSE:
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'
Traceback (most recent call last):
File "/usr/lib/canto/canto/main.py", line 79, in __init__
self.cfg.parse()
File "/usr/lib/canto/canto/cfg/base.py", line 146, in parse
exec(data.encode("UTF-8"), {}, self.locals)
File "", line 587, in
File "/usr/lib/canto/canto/extra.py", line 321, in highlight_word
reg = re.compile(r"\b(" + re.escape(word) + r")\b", flags)
File "/usr/lib/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.7/re.py", line 242, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python2.7/sre_compile.py", line 500, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python2.7/sre_parse.py", line 673, in parse
p = _parse_sub(source, pattern, 0)
File "/usr/lib/python2.7/sre_parse.py", line 308, in _parse_sub
itemsappend(_parse(source, state))
File "/usr/lib/python2.7/sre_parse.py", line 401, in _parse
if state.flags & SRE_FLAG_VERBOSE:
TypeError: unsupported operand type(s) for &: 'NoneType' and 'int'

If you're having trouble upgrading from 0.6.x please visit
http://codezen.org/canto/config/#upgrading-from-06x