From 86a4566abffff7289bf349f1d0d557ab472d31ba Mon Sep 17 00:00:00 2001 From: Zsolt Foldvari Date: Fri, 2 May 2008 10:14:39 +0000 Subject: [PATCH] Avoid accessing private class variable in StyledTextTagType. svn: r10655 --- src/Editors/_StyledTextBuffer.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Editors/_StyledTextBuffer.py b/src/Editors/_StyledTextBuffer.py index a3d2b317d..1e0e6230e 100644 --- a/src/Editors/_StyledTextBuffer.py +++ b/src/Editors/_StyledTextBuffer.py @@ -54,8 +54,15 @@ from gen.lib import (StyledText, StyledTextTag, StyledTextTagType) # Constants # #------------------------------------------------------------------------- -# FIXME -ALLOWED_STYLES = [i for (i, s, e) in StyledTextTagType._DATAMAP] +ALLOWED_STYLES = ( + StyledTextTagType.BOLD, + StyledTextTagType.ITALIC, + StyledTextTagType.UNDERLINE, + StyledTextTagType.FONTCOLOR, + StyledTextTagType.HIGHLIGHT, + StyledTextTagType.FONTFACE, + StyledTextTagType.FONTSIZE, +) STYLE_TO_PROPERTY = { StyledTextTagType.BOLD: 'weight', # permanent tag is used instead @@ -65,7 +72,6 @@ STYLE_TO_PROPERTY = { StyledTextTagType.HIGHLIGHT: 'background', StyledTextTagType.FONTFACE: 'family', StyledTextTagType.FONTSIZE: 'size-points', - StyledTextTagType.SUPERSCRIPT: 'rise', } (MATCH_START,