Changeset 226:473bbc9d355f for src/mlx/gui/common.py
- Timestamp:
- 06/05/12 15:42:34 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r225 r226 57 57 58 58 POLICY_AUTOMATIC = gtk.POLICY_AUTOMATIC 59 60 WEIGHT_BOLD = pango.WEIGHT_BOLD 59 61 60 62 def text2unicode(text): … … 105 107 POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC 106 108 109 WEIGHT_BOLD = pango.Weight.BOLD 110 107 111 import codecs 108 112 _utf8Decoder = codecs.getdecoder("utf-8") … … 228 232 #------------------------------------------------------------------------------ 229 233 230 def formatFlightLogLine(timeStr, line , isFault = False):234 def formatFlightLogLine(timeStr, line): 231 235 """Format the given flight log line.""" 232 236 """Format the given line for flight logging.""" 233 237 if timeStr is not None: 234 238 line = timeStr + ": " + line 235 #if isFault:236 # line = "<b>" + line + "</b>"237 239 return line + "\n" 238 240 239 241 #------------------------------------------------------------------------------ 242 243 def addFaultTag(buffer): 244 """Add a tag named 'fault' to the given buffer.""" 245 faultTag = gtk.TextTag(name = "fault") 246 faultTag.set_property("foreground", "red") 247 faultTag.set_property("weight", WEIGHT_BOLD) 248 buffer.get_tag_table().add(faultTag) 249 250 #------------------------------------------------------------------------------ 251 252 def appendTextBuffer(buffer, text, isFault = False): 253 """Append the given line at the end of the given text buffer. 254 255 If isFault is set, use the tag named 'fault'.""" 256 if isFault: 257 buffer.insert_with_tags_by_name(buffer.get_end_iter(), text, 258 "fault") 259 else: 260 buffer.insert(buffer.get_end_iter(), text) 261 262 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.