wx.py.shell

Why does the shell in wx.py.shell color-codes the words inside the traceback?
(i.e. words like `in`, `and` have different color) Is this intentional?

Hello,

···

On May 9, 2009, at 2:29 PM, cool-RR wrote:

Why does the shell in wx.py.shell color-codes the words inside the traceback?
(i.e. words like `in`, `and` have different color) Is this intentional?

Its because wx.py.shell is just a StyledTextCtrl that is using the Python Lexer to highlight the text. So it sees those keywords in the buffer and highlights them accordingly.

Cody

cool-RR wrote:

Why does the shell in wx.py.shell color-codes the words inside the traceback?
(i.e. words like `in`, `and` have different color) Is this intentional?

It's just using Scintilla's stock Python lexer and is not distinguishing between Python code and any other text that is displayed. If you would like to change this I would be happy to apply a patch.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Its because wx.py.shell is just a StyledTextCtrl that is using the
Python Lexer to highlight the text. So it sees those keywords in the
buffer and highlights them accordingly.

Cody

So is the only reason it does it is because no one cared to customize it to do
otherwise?

Hello,

···

On May 9, 2009, at 4:13 PM, cool-RR wrote:

Its because wx.py.shell is just a StyledTextCtrl that is using the
Python Lexer to highlight the text. So it sees those keywords in the
buffer and highlights them accordingly.

Cody

So is the only reason it does it is because no one cared to customize it to do
otherwise?

I would say that that is more or less true, you would need to write a custom container lexer to use instead of the builtin python one to properly highlight the text. It probably wouldn't be to hard to write since it only would only have to work on a per line basis and wouldn't have to worry about style changes in previous lines.

Cody