<s> import Tkinter as tk <EOL> from rwb . widgets import DynamicTableEditor <EOL> from rwb . editor import DteMargin <EOL> class KeywordDTE ( DynamicTableEditor ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> DynamicTableEditor . __init__ ( self , * args , ** kwargs ) <EOL> self . margin = DteMargin ( self , width = <NUM_LIT:32> , background = self . cget ( "<STR_LIT>" ) , <EOL> borderwidth = <NUM_LIT:0> , highlightthickness = <NUM_LIT:0> ) <EOL> self . margin . attach ( self ) <EOL> def get_current_statement ( self ) : <EOL> '''<STR_LIT>''' <EOL> text = self . get_current_statement_text ( ) <EOL> if not text . lstrip ( ) . startswith ( "<STR_LIT:|>" ) : text = "<STR_LIT>" + text <EOL> lines = text . split ( "<STR_LIT:\n>" ) <EOL> statement = self . _split_row ( lines [ <NUM_LIT:0> ] ) <EOL> for line in lines [ <NUM_LIT:1> : ] : <EOL> line = line . strip ( "<STR_LIT>" ) <EOL> line = "<STR_LIT>" + line <EOL> row = self . _split_row ( line ) <EOL> statement . extend ( row [ <NUM_LIT:1> : ] ) <EOL> return statement <EOL> def find_start_of_statement ( self , index = "<STR_LIT>" ) : <EOL> '''<STR_LIT>''' <EOL> mark = "<STR_LIT>" <EOL> self . mark_set ( mark , "<STR_LIT>" % index ) <EOL> while ( self . compare ( mark , "<STR_LIT:>>" , "<STR_LIT:1.0>" ) and <EOL> self . get ( mark , "<STR_LIT>" % mark ) . lstrip ( "<STR_LIT>" ) . startswith ( "<STR_LIT>" ) ) : <EOL> self . mark_set ( mark , "<STR_LIT>" % mark ) <EOL> return self . index ( mark ) <EOL> def find_end_of_statement ( self , index = "<STR_LIT>" ) : <EOL> '''<STR_LIT>''' <EOL> mark = "<STR_LIT>" <EOL> self . mark_set ( mark , "<STR_LIT>" % index ) <EOL> while ( self . compare ( mark , "<STR_LIT:<>" , "<STR_LIT:end>" ) and <EOL> self . get ( "<STR_LIT>" % mark , "<STR_LIT>" % mark ) . lstrip ( "<STR_LIT>" ) . startswith ( "<STR_LIT>" ) ) : <EOL> self . mark_set ( mark , "<STR_LIT>" % mark ) <EOL> return self . index ( mark ) </s>
