(self, parent, filename)
Configure tags and feed file to parser.
Configure tags and feed file to parser.
Configure tags and feed file to parser .
def __init__(self, parent, filename):
        "Configure tags and feed file to parser."
        uwide = idleConf.GetOption('main', 'EditorWindow', 'width', type='int')
        uhigh = idleConf.GetOption('main', 'EditorWindow', 'height', type='int')
        uhigh = 3 * uhigh // 4  # Lines average 4/3 of editor line height.
        Text.__init__(self, parent, wrap='word', highlightthickness=0,
                      padx=5, borderwidth=0, width=uwide, height=uhigh)

        normalfont = self.findfont(['TkDefaultFont', 'arial', 'helvetica'])
        fixedfont = self.findfont(['TkFixedFont', 'monaco', 'courier'])
        self['font'] = (normalfont, 12)
        self.tag_configure('em', font=(normalfont, 12, 'italic'))
        self.tag_configure('h1', font=(normalfont, 20, 'bold'))
        self.tag_configure('h2', font=(normalfont, 18, 'bold'))
        self.tag_configure('h3', font=(normalfont, 15, 'bold'))
        self.tag_configure('pre', font=(fixedfont, 12), background='#f6f6ff')
        self.tag_configure('preblock', font=(fixedfont, 10), lmargin1=25,
                borderwidth=1, relief='solid', background='#eeffcc')
        self.tag_configure('l1', lmargin1=25, lmargin2=25)
        self.tag_configure('l2', lmargin1=50, lmargin2=50)
        self.tag_configure('l3', lmargin1=75, lmargin2=75)
        self.tag_configure('l4', lmargin1=100, lmargin2=100)

        self.parser = HelpParser(self)
        with open(filename, encoding='utf-8') as f:
            contents = f.read()
        self.parser.feed(contents)
        self['state'] = 'disabled'
def __init__ ( self , parent , filename ) : uwide = idleConf . GetOption ( 'main' , 'EditorWindow' , 'width' , type = 'int' ) uhigh = idleConf . GetOption ( 'main' , 'EditorWindow' , 'height' , type = 'int' ) uhigh = 3 * uhigh // 4 # Lines average 4/3 of editor line height. Text . __init__ ( self , parent , wrap = 'word' , highlightthickness = 0 , padx = 5 , borderwidth = 0 , width = uwide , height = uhigh ) normalfont = self . findfont ( [ 'TkDefaultFont' , 'arial' , 'helvetica' ] ) fixedfont = self . findfont ( [ 'TkFixedFont' , 'monaco' , 'courier' ] ) self [ 'font' ] = ( normalfont , 12 ) self . tag_configure ( 'em' , font = ( normalfont , 12 , 'italic' ) ) self . tag_configure ( 'h1' , font = ( normalfont , 20 , 'bold' ) ) self . tag_configure ( 'h2' , font = ( normalfont , 18 , 'bold' ) ) self . tag_configure ( 'h3' , font = ( normalfont , 15 , 'bold' ) ) self . tag_configure ( 'pre' , font = ( fixedfont , 12 ) , background = '#f6f6ff' ) self . tag_configure ( 'preblock' , font = ( fixedfont , 10 ) , lmargin1 = 25 , borderwidth = 1 , relief = 'solid' , background = '#eeffcc' ) self . tag_configure ( 'l1' , lmargin1 = 25 , lmargin2 = 25 ) self . tag_configure ( 'l2' , lmargin1 = 50 , lmargin2 = 50 ) self . tag_configure ( 'l3' , lmargin1 = 75 , lmargin2 = 75 ) self . tag_configure ( 'l4' , lmargin1 = 100 , lmargin2 = 100 ) self . parser = HelpParser ( self ) with open ( filename , encoding = 'utf-8' ) as f : contents = f . read ( ) self . parser . feed ( contents ) self [ 'state' ] = 'disabled'