30 |
30 |
31 class PythonCodeEditor(CodeEditor): |
31 class PythonCodeEditor(CodeEditor): |
32 |
32 |
33 KEYWORDS = keyword.kwlist |
33 KEYWORDS = keyword.kwlist |
34 COMMENT_HEADER = "#" |
34 COMMENT_HEADER = "#" |
35 |
35 |
36 def SetCodeLexer(self): |
36 def SetCodeLexer(self): |
37 self.SetLexer(stc.STC_LEX_PYTHON) |
37 self.SetLexer(stc.STC_LEX_PYTHON) |
38 |
38 |
39 # Line numbers in margin |
39 # Line numbers in margin |
40 self.StyleSetSpec(stc.STC_STYLE_LINENUMBER,'fore:#000000,back:#99A9C2,size:%(size)d' % faces) |
40 self.StyleSetSpec(stc.STC_STYLE_LINENUMBER,'fore:#000000,back:#99A9C2,size:%(size)d' % faces) |
41 # Highlighted brace |
41 # Highlighted brace |
42 self.StyleSetSpec(stc.STC_STYLE_BRACELIGHT,'fore:#00009D,back:#FFFF00,size:%(size)d' % faces) |
42 self.StyleSetSpec(stc.STC_STYLE_BRACELIGHT,'fore:#00009D,back:#FFFF00,size:%(size)d' % faces) |
43 # Unmatched brace |
43 # Unmatched brace |
44 self.StyleSetSpec(stc.STC_STYLE_BRACEBAD,'fore:#00009D,back:#FF0000,size:%(size)d' % faces) |
44 self.StyleSetSpec(stc.STC_STYLE_BRACEBAD,'fore:#00009D,back:#FF0000,size:%(size)d' % faces) |
45 # Indentation guide |
45 # Indentation guide |
67 # Operators |
67 # Operators |
68 self.StyleSetSpec(stc.STC_P_OPERATOR, 'fore:#800000,bold,size:%(size)d' % faces) |
68 self.StyleSetSpec(stc.STC_P_OPERATOR, 'fore:#800000,bold,size:%(size)d' % faces) |
69 # Identifiers. I leave this as not bold because everything seems |
69 # Identifiers. I leave this as not bold because everything seems |
70 # to be an identifier if it doesn't match the above criterae |
70 # to be an identifier if it doesn't match the above criterae |
71 self.StyleSetSpec(stc.STC_P_IDENTIFIER, 'fore:#000000,size:%(size)d' % faces) |
71 self.StyleSetSpec(stc.STC_P_IDENTIFIER, 'fore:#000000,size:%(size)d' % faces) |
72 |
72 |
73 |
73 |
74 #------------------------------------------------------------------------------- |
74 #------------------------------------------------------------------------------- |
75 # CFileEditor Main Frame Class |
75 # CFileEditor Main Frame Class |
76 #------------------------------------------------------------------------------- |
76 #------------------------------------------------------------------------------- |
77 |
77 |
78 class PythonEditor(CodeFileEditor): |
78 class PythonEditor(CodeFileEditor): |
79 |
79 |
80 CONFNODEEDITOR_TABS = [ |
80 CONFNODEEDITOR_TABS = [ |
81 (_("Python code"), "_create_CodePanel")] |
81 (_("Python code"), "_create_CodePanel")] |
82 CODE_EDITOR = PythonCodeEditor |
82 CODE_EDITOR = PythonCodeEditor |
83 |
|