Exemple #1
0
 def start_body(self, attrs):
     HTMLParser.start_body(self, attrs)
     if not self.app.prefs.GetBoolean('parsing-html', 'honor-colors'):
         return
     from grailutil import conv_normstring
     bgcolor = extract_keyword('bgcolor', attrs, conv=conv_normstring)
     if bgcolor:
         clr = self.configcolor('background', bgcolor)
         if clr:
             #  Normally not important, but ISINDEX would cause
             #  these to be non-empty, as would all sorts of illegal stuff:
             for hr in self.viewer.rules + self.viewer.subwindows:
                 hr.config(highlightbackground=clr)
     self.configcolor('foreground',
                      extract_keyword('text', attrs, conv=conv_normstring))
     self.configcolor('foreground',
                      extract_keyword('link', attrs, conv=conv_normstring),
                      'a')
     self.configcolor('foreground',
                      extract_keyword('vlink', attrs, conv=conv_normstring),
                      'ahist')
     self.configcolor('foreground',
                      extract_keyword('alink', attrs, conv=conv_normstring),
                      'atemp')
 def start_body(self, attrs):
     HTMLParser.start_body(self, attrs)
     if not self.app.prefs.GetBoolean('parsing-html', 'honor-colors'):
         return
     from grailutil import conv_normstring
     bgcolor = extract_keyword('bgcolor', attrs, conv=conv_normstring)
     if bgcolor:
         clr = self.configcolor('background', bgcolor)
         if clr:
             #  Normally not important, but ISINDEX would cause
             #  these to be non-empty, as would all sorts of illegal stuff:
             for hr in self.viewer.rules + self.viewer.subwindows:
                 hr.config(highlightbackground = clr)
     self.configcolor('foreground',
                      extract_keyword('text', attrs, conv=conv_normstring))
     self.configcolor('foreground',
                      extract_keyword('link', attrs, conv=conv_normstring),
                      'a')
     self.configcolor('foreground',
                      extract_keyword('vlink', attrs, conv=conv_normstring),
                      'ahist')
     self.configcolor('foreground',
                      extract_keyword('alink', attrs, conv=conv_normstring),
                      'atemp')