<s> import vdebug . ui . interface <EOL> import vdebug . util <EOL> import vim <EOL> import vdebug . log <EOL> import vdebug . opts <EOL> class Ui ( vdebug . ui . interface . Ui ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , breakpoints ) : <EOL> vdebug . ui . interface . Ui . __init__ ( self ) <EOL> self . is_open = False <EOL> self . breakpoint_store = breakpoints <EOL> self . emptybuffer = None <EOL> self . breakpointwin = BreakpointWindow ( self , '<STR_LIT>' ) <EOL> self . current_tab = "<STR_LIT:1>" <EOL> self . tabnr = None <EOL> def is_modified ( self ) : <EOL> modified = int ( vim . eval ( '<STR_LIT>' ) ) <EOL> if modified : <EOL> return True <EOL> else : <EOL> return False <EOL> def open ( self ) : <EOL> if self . is_open : <EOL> return <EOL> self . is_open = True <EOL> try : <EOL> existing_buffer = True <EOL> cur_buf_name = vim . eval ( "<STR_LIT>" ) <EOL> if cur_buf_name is None : <EOL> existing_buffer = False <EOL> cur_buf_name = '<STR_LIT>' <EOL> self . current_tab = vim . eval ( "<STR_LIT>" ) <EOL> vim . command ( '<STR_LIT>' ) <EOL> self . empty_buf_num = vim . eval ( '<STR_LIT>' ) <EOL> if existing_buffer : <EOL> vim . command ( '<STR_LIT>' % cur_buf_name ) <EOL> self . tabnr = vim . eval ( "<STR_LIT>" ) <EOL> srcwin_name = self . __get_srcwin_name ( ) <EOL> self . watchwin = WatchWindow ( self , '<STR_LIT>' ) <EOL> self . watchwin . create ( ) <EOL> self . stackwin = StackWindow ( self , '<STR_LIT>' ) <EOL> self . stackwin . create ( ) <EOL> self . statuswin = StatusWindow ( self , '<STR_LIT>' ) <EOL> self . statuswin . create ( ) <EOL> self . statuswin . set_status ( "<STR_LIT>" ) <EOL> self . tracewin = TraceWindow ( self , '<STR_LIT>' ) <EOL> self . watchwin . set_height ( <NUM_LIT:20> ) <EOL> self . statuswin . set_height ( <NUM_LIT:5> ) <EOL> logwin = LogWindow ( self , '<STR_LIT>' ) <EOL> vdebug . log . Log . set_logger ( vdebug . log . WindowLogger ( vdebug . opts . Options . get ( '<STR_LIT>' ) , logwin ) ) <EOL> winnr = self . __get_srcwinno_by_name ( srcwin_name ) <EOL> self . sourcewin = SourceWindow ( self , winnr ) <EOL> self . sourcewin . focus ( ) <EOL> except Exception , e : <EOL> self . is_open = False <EOL> raise e <EOL> def set_source_position ( self , file , lineno ) : <EOL> self . sourcewin . set_file ( file ) <EOL> self . sourcewin . set_line ( lineno ) <EOL> self . sourcewin . place_pointer ( lineno ) <EOL> def mark_as_stopped ( self ) : <EOL> if self . is_open : <EOL> if self . sourcewin : <EOL> self . sourcewin . remove_pointer ( ) <EOL> if self . statuswin : <EOL> self . statuswin . set_status ( "<STR_LIT>" ) <EOL> self . remove_conn_details ( ) <EOL> def set_conn_details ( self , addr , port ) : <EOL> self . statuswin . insert ( "<STR_LIT>" % ( addr , port ) , <NUM_LIT:2> , True ) <EOL> def remove_conn_details ( self ) : <EOL> self . statuswin . insert ( "<STR_LIT>" , <NUM_LIT:2> , True ) <EOL> def set_listener_details ( self , addr , port , idekey ) : <EOL> details = "<STR_LIT>" % ( addr , port ) <EOL> if len ( idekey ) : <EOL> details += "<STR_LIT>" % idekey <EOL> self . statuswin . insert ( details , <NUM_LIT:1> , True ) <EOL> def get_current_file ( self ) : <EOL> return vdebug . util . LocalFilePath ( vim . current . buffer . name ) <EOL> def get_current_row ( self ) : <EOL> return vim . current . window . cursor [ <NUM_LIT:0> ] <EOL> def get_current_line ( self ) : <EOL> return self . get_line ( self . get_current_row ( ) ) <EOL> def get_line ( self , row ) : <EOL> return vim . eval ( "<STR_LIT>" + str ( row ) + "<STR_LIT:)>" ) <EOL> def register_breakpoint ( self , breakpoint ) : <EOL> if breakpoint . type == '<STR_LIT>' : <EOL> self . place_breakpoint ( breakpoint . id , breakpoint . file , breakpoint . line ) <EOL> if self . breakpointwin . is_open : <EOL> self . breakpointwin . add_breakpoint ( breakpoint ) <EOL> def place_breakpoint ( self , sign_id , file , line ) : <EOL> vim . command ( '<STR_LIT>' + str ( sign_id ) + '<STR_LIT>' + str ( line ) + '<STR_LIT>' + file . as_local ( ) ) <EOL> def remove_breakpoint ( self , breakpoint ) : <EOL> id = breakpoint . id <EOL> vim . command ( '<STR_LIT>' % id ) <EOL> if self . breakpointwin . is_open : <EOL> self . breakpointwin . remove_breakpoint ( id ) <EOL> def get_breakpoint_sign_positions ( self ) : <EOL> sign_lines = self . command ( '<STR_LIT>' ) . split ( "<STR_LIT:\n>" ) <EOL> positions = { } <EOL> for line in sign_lines : <EOL> if "<STR_LIT>" in line : <EOL> attributes = line . strip ( ) . split ( ) <EOL> lineinfo = attributes [ <NUM_LIT:0> ] . split ( '<STR_LIT:=>' ) <EOL> idinfo = attributes [ <NUM_LIT:1> ] . split ( '<STR_LIT:=>' ) <EOL> positions [ idinfo [ <NUM_LIT:1> ] ] = lineinfo [ <NUM_LIT:1> ] <EOL> return positions <EOL> def command ( self , cmd ) : <EOL> vim . command ( '<STR_LIT>' ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> vim . command ( '<STR_LIT>' ) <EOL> return vim . eval ( '<STR_LIT>' ) <EOL> def say ( self , string ) : <EOL> """<STR_LIT>""" <EOL> print str ( string ) <EOL> vdebug . log . Log ( string , vdebug . log . Logger . INFO ) <EOL> def error ( self , string ) : <EOL> vim . command ( '<STR_LIT>' + str ( string ) . replace ( '<STR_LIT:">' , '<STR_LIT>' ) + '<STR_LIT>' ) <EOL> vdebug . log . Log ( string , vdebug . log . Logger . ERROR ) <EOL> def close ( self ) : <EOL> if not self . is_open : <EOL> return <EOL> self . is_open = False <EOL> vdebug . log . Log . remove_logger ( '<STR_LIT>' ) <EOL> if self . tabnr : <EOL> vim . command ( '<STR_LIT>' + self . tabnr + '<STR_LIT>' ) <EOL> if self . current_tab : <EOL> vim . command ( '<STR_LIT>' + self . current_tab ) <EOL> if self . empty_buf_num : <EOL> vim . command ( '<STR_LIT>' + self . empty_buf_num ) <EOL> if self . watchwin : <EOL> self . watchwin . destroy ( ) <EOL> if self . stackwin : <EOL> self . stackwin . destroy ( ) <EOL> if self . statuswin : <EOL> self . statuswin . destroy ( ) <EOL> if self . tracewin : <EOL> self . tracewin . destroy ( ) <EOL> self . watchwin = None <EOL> self . stackwin = None <EOL> self . statuswin = None <EOL> self . tracewin = None <EOL> def __get_srcwin_name ( self ) : <EOL> return vim . current . buffer . name <EOL> def __get_srcwinno_by_name ( self , name ) : <EOL> i = <NUM_LIT:1> <EOL> vdebug . log . Log ( "<STR_LIT>" % name , vdebug . log . Logger . INFO ) <EOL> for w in vim . windows : <EOL> vdebug . log . Log ( "<STR_LIT>" % ( i , w . buffer . name ) , vdebug . log . Logger . INFO ) <EOL> if w . buffer . name == name : <EOL> break <EOL> else : <EOL> i += <NUM_LIT:1> <EOL> vdebug . log . Log ( "<STR_LIT>" % i , vdebug . log . Logger . INFO ) <EOL> return i <EOL> def __get_buf_list ( self ) : <EOL> return vim . eval ( "<STR_LIT>" ) <EOL> class SourceWindow ( vdebug . ui . interface . Window ) : <EOL> file = None <EOL> pointer_sign_id = '<STR_LIT>' <EOL> breakpoint_sign_id = '<STR_LIT>' <EOL> def __init__ ( self , ui , winno ) : <EOL> self . winno = str ( winno ) <EOL> def focus ( self ) : <EOL> vim . command ( self . winno + "<STR_LIT>" ) <EOL> def command ( self , cmd , silent = True ) : <EOL> self . focus ( ) <EOL> if silent : <EOL> prepend = "<STR_LIT>" <EOL> else : <EOL> prepend = "<STR_LIT>" <EOL> command_str = prepend + self . winno + "<STR_LIT>" + cmd <EOL> vim . command ( command_str ) <EOL> def set_file ( self , file ) : <EOL> if file == self . file : <EOL> return <EOL> self . file = file <EOL> vdebug . log . Log ( "<STR_LIT>" + file , vdebug . log . Logger . INFO ) <EOL> self . focus ( ) <EOL> vim . command ( '<STR_LIT>' % str ( file ) . replace ( "<STR_LIT:\\>" , "<STR_LIT>" ) ) <EOL> def set_line ( self , lineno ) : <EOL> self . focus ( ) <EOL> vim . command ( "<STR_LIT>" % str ( lineno ) ) <EOL> def get_file ( self ) : <EOL> self . focus ( ) <EOL> self . file = vdebug . util . LocalFilePath ( vim . eval ( "<STR_LIT>" ) ) <EOL> return self . file <EOL> def clear_signs ( self ) : <EOL> vim . command ( '<STR_LIT>' ) <EOL> def place_pointer ( self , line ) : <EOL> vdebug . log . Log ( "<STR_LIT>" + str ( line ) , vdebug . log . Logger . INFO ) <EOL> self . remove_pointer ( ) <EOL> vim . command ( '<STR_LIT>' + self . pointer_sign_id + '<STR_LIT>' + str ( line ) + '<STR_LIT>' + self . file ) <EOL> def remove_pointer ( self ) : <EOL> vim . command ( '<STR_LIT>' % self . pointer_sign_id ) <EOL> class Window ( vdebug . ui . interface . Window ) : <EOL> name = "<STR_LIT>" <EOL> open_cmd = "<STR_LIT>" <EOL> creation_count = <NUM_LIT:0> <EOL> def __init__ ( self , ui , open_cmd ) : <EOL> self . buffer = None <EOL> self . ui = ui <EOL> self . open_cmd = open_cmd <EOL> self . is_open = False <EOL> def getwinnr ( self ) : <EOL> return int ( vim . eval ( "<STR_LIT>" + self . name + "<STR_LIT>" ) ) <EOL> def set_height ( self , height ) : <EOL> height = int ( height ) <EOL> minheight = int ( vim . eval ( "<STR_LIT>" ) ) <EOL> if height < minheight : <EOL> height = minheight <EOL> if height <= <NUM_LIT:0> : <EOL> height = <NUM_LIT:1> <EOL> self . command ( '<STR_LIT>' % height ) <EOL> def write ( self , msg , return_focus = True , after = "<STR_LIT>" ) : <EOL> if not self . is_open : <EOL> self . create ( ) <EOL> if return_focus : <EOL> prev_win = vim . eval ( '<STR_LIT>' ) <EOL> if self . buffer_empty ( ) : <EOL> self . buffer [ : ] = str ( msg ) . split ( '<STR_LIT:\n>' ) <EOL> else : <EOL> self . buffer . append ( str ( msg ) . split ( '<STR_LIT:\n>' ) ) <EOL> self . command ( after ) <EOL> if return_focus : <EOL> vim . command ( '<STR_LIT>' % prev_win ) <EOL> def insert ( self , msg , lineno = None , overwrite = False , allowEmpty = False ) : <EOL> if not self . is_open : <EOL> self . create ( ) <EOL> """<STR_LIT>""" <EOL> if len ( msg ) == <NUM_LIT:0> and allowEmpty == False : <EOL> return <EOL> if self . buffer_empty ( ) : <EOL> self . buffer [ : ] = str ( msg ) . split ( '<STR_LIT:\n>' ) <EOL> else : <EOL> if lineno == None : <EOL> ( lineno , rol ) = vim . current . window . cursor <EOL> remaining_buffer = str ( msg ) . split ( '<STR_LIT:\n>' ) <EOL> if overwrite : <EOL> lfrom = lineno + <NUM_LIT:1> <EOL> else : <EOL> lfrom = lineno <EOL> remaining_buffer . extend ( self . buffer [ lfrom : ] ) <EOL> del self . buffer [ lineno : ] <EOL> if self . buffer_empty ( ) : <EOL> self . buffer [ : ] = remaining_buffer <EOL> else : <EOL> for line in remaining_buffer : <EOL> self . buffer . append ( line ) <EOL> self . command ( str ( lfrom ) ) <EOL> def delete ( self , start_line , end_line ) : <EOL> try : <EOL> self . buffer [ end_line ] <EOL> remaining_buffer = self . buffer [ end_line : ] <EOL> del self . buffer [ start_line : ] <EOL> self . buffer . append ( remaining_buffer ) <EOL> except IndexError : <EOL> del self . buffer [ start_line : ] <EOL> def buffer_empty ( self ) : <EOL> if len ( self . buffer ) == <NUM_LIT:1> and len ( self . buffer [ <NUM_LIT:0> ] ) == <NUM_LIT:0> : <EOL> return True <EOL> else : <EOL> return False <EOL> def create ( self ) : <EOL> """<STR_LIT>""" <EOL> vim . command ( '<STR_LIT>' + self . open_cmd + '<STR_LIT:U+0020>' + self . name ) <EOL> vim . command ( "<STR_LIT>" + "<STR_LIT>" ) <EOL> self . buffer = vim . current . buffer <EOL> self . is_open = True <EOL> self . creation_count += <NUM_LIT:1> <EOL> self . on_create ( ) <EOL> def destroy ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . buffer == None or len ( dir ( self . buffer ) ) == <NUM_LIT:0> : <EOL> return <EOL> self . is_open = False <EOL> if int ( vim . eval ( '<STR_LIT>' + self . name + '<STR_LIT>' ) ) == <NUM_LIT:1> : <EOL> vim . command ( '<STR_LIT>' + self . name ) <EOL> self . on_destroy ( ) <EOL> def clean ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . is_open : <EOL> self . buffer [ : ] = [ ] <EOL> def command ( self , cmd ) : <EOL> """<STR_LIT>""" <EOL> winnr = self . getwinnr ( ) <EOL> if winnr != int ( vim . eval ( "<STR_LIT>" ) ) : <EOL> vim . command ( str ( winnr ) + '<STR_LIT>' ) <EOL> vim . command ( cmd ) <EOL> def accept_renderer ( self , renderer ) : <EOL> self . write ( renderer . render ( ) ) <EOL> class BreakpointWindow ( Window ) : <EOL> name = "<STR_LIT>" <EOL> is_visible = False <EOL> header = """<STR_LIT>""" <EOL> def on_create ( self ) : <EOL> self . clean ( ) <EOL> self . write ( self . header ) <EOL> self . command ( '<STR_LIT>' ) <EOL> for bp in self . ui . breakpoint_store . get_sorted_list ( ) : <EOL> self . add_breakpoint ( bp ) <EOL> if self . creation_count == <NUM_LIT:1> : <EOL> cmd = '<STR_LIT>' % ( self . name , self . name ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> def add_breakpoint ( self , breakpoint ) : <EOL> bp_str = "<STR_LIT>" % ( breakpoint . id , breakpoint . type ) <EOL> if breakpoint . type == '<STR_LIT>' : <EOL> bp_str += "<STR_LIT>" % ( breakpoint . file , str ( breakpoint . line ) ) <EOL> elif breakpoint . type == '<STR_LIT>' : <EOL> bp_str += "<STR_LIT>" % ( breakpoint . file , str ( breakpoint . line ) , breakpoint . condition ) <EOL> elif breakpoint . type == '<STR_LIT>' : <EOL> bp_str += "<STR_LIT>" % breakpoint . exception <EOL> elif breakpoint . type == '<STR_LIT>' or breakpoint . type == '<STR_LIT>' : <EOL> bp_str += "<STR_LIT>" % breakpoint . function <EOL> self . write ( bp_str ) <EOL> def remove_breakpoint ( self , breakpoint_id ) : <EOL> i = <NUM_LIT:0> <EOL> for l in self . buffer : <EOL> bp_str = "<STR_LIT>" % breakpoint_id <EOL> bp_id_len = len ( bp_str ) <EOL> if l [ : bp_id_len ] == bp_str : <EOL> del self . buffer [ i ] <EOL> i += <NUM_LIT:1> <EOL> class LogWindow ( Window ) : <EOL> name = "<STR_LIT>" <EOL> def on_create ( self ) : <EOL> self . command ( '<STR_LIT>' ) <EOL> if self . creation_count == <NUM_LIT:1> : <EOL> cmd = '<STR_LIT>' % ( self . name , self . name ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> def write ( self , msg , return_focus = True ) : <EOL> Window . write ( self , msg , return_focus = True ) <EOL> class StackWindow ( Window ) : <EOL> name = "<STR_LIT>" <EOL> def on_create ( self ) : <EOL> self . command ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> self . command ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> self . command ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> self . command ( '<STR_LIT>' ) <EOL> if self . creation_count == <NUM_LIT:1> : <EOL> cmd = '<STR_LIT>' % ( self . name , self . name ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> def write ( self , msg , return_focus = True ) : <EOL> Window . write ( self , msg , after = "<STR_LIT>" ) <EOL> class WatchWindow ( Window ) : <EOL> name = "<STR_LIT>" <EOL> def on_create ( self ) : <EOL> self . command ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> self . command ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> self . command ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> self . command ( '<STR_LIT>' ) <EOL> if self . creation_count == <NUM_LIT:1> : <EOL> cmd = '<STR_LIT>' % ( self . name , self . name ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> def write ( self , msg , return_focus = True ) : <EOL> Window . write ( self , msg , after = "<STR_LIT>" ) <EOL> class StatusWindow ( Window ) : <EOL> name = "<STR_LIT>" <EOL> def on_create ( self ) : <EOL> keys = vdebug . util . Keymapper ( ) <EOL> output = "<STR_LIT>" <EOL> output += "<STR_LIT>" % ( keys . run_key ( ) ) <EOL> output += "<STR_LIT>" % ( keys . close_key ( ) ) <EOL> output += "<STR_LIT>" <EOL> self . write ( output ) <EOL> self . command ( '<STR_LIT>' ) <EOL> if self . creation_count == <NUM_LIT:1> : <EOL> cmd = '<STR_LIT>' % ( self . name , self . name ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> def set_status ( self , status ) : <EOL> self . insert ( "<STR_LIT>" + str ( status ) , <NUM_LIT:0> , True ) <EOL> class TraceWindow ( WatchWindow ) : <EOL> name = "<STR_LIT>" <EOL> def on_create ( self ) : <EOL> if self . creation_count == <NUM_LIT:1> : <EOL> cmd = '<STR_LIT>' % ( self . name , self . name ) <EOL> vim . command ( '<STR_LIT>' % cmd ) <EOL> self . command ( '<STR_LIT>' ) <EOL> def set_trace_expression ( self , trace_expression ) : <EOL> self . _trace_expression = trace_expression <EOL> def is_tracing ( self ) : <EOL> if self . is_open : <EOL> return self . _trace_expression is not None <EOL> def get_trace_expression ( self ) : <EOL> return self . _trace_expression <EOL> def render ( self , renderer ) : <EOL> self . _last_context_rendered = renderer <EOL> self . accept_renderer ( renderer ) <EOL> def render_in_error_case ( self ) : <EOL> if self . _last_context_rendered is None : <EOL> self . write ( str ( self . _trace_expression ) ) <EOL> else : <EOL> self . write ( '<STR_LIT>' + str ( self . _last_context_rendered ) ) <EOL> def on_destroy ( self ) : <EOL> self . _trace_expression = None <EOL> self . _last_context_rendered = None <EOL> class ResponseRenderer : <EOL> def __init__ ( self , response ) : <EOL> self . response = response <EOL> def render ( self ) : <EOL> pass <EOL> class StackGetResponseRenderer ( ResponseRenderer ) : <EOL> def render ( self ) : <EOL> stack = self . response . get_stack ( ) <EOL> string = "<STR_LIT>" <EOL> for s in stack : <EOL> if s . get ( '<STR_LIT>' ) : <EOL> where = s . get ( '<STR_LIT>' ) <EOL> else : <EOL> where = '<STR_LIT>' <EOL> file = vdebug . util . FilePath ( s . get ( '<STR_LIT:filename>' ) ) <EOL> line = "<STR_LIT>" % { '<STR_LIT>' : s . get ( '<STR_LIT>' ) , '<STR_LIT>' : where , '<STR_LIT:file>' : str ( file . as_local ( ) ) , '<STR_LIT>' : s . get ( '<STR_LIT>' ) } <EOL> string += line + "<STR_LIT:\n>" <EOL> return string <EOL> class ContextGetResponseRenderer ( ResponseRenderer ) : <EOL> def __init__ ( self , response , title = None , contexts = { } , current_context = <NUM_LIT:0> ) : <EOL> ResponseRenderer . __init__ ( self , response ) <EOL> self . title = title <EOL> self . contexts = contexts <EOL> self . current_context = current_context <EOL> def render ( self , indent = <NUM_LIT:0> ) : <EOL> res = self . __create_tabs ( ) <EOL> if self . title : <EOL> res += "<STR_LIT>" % self . title <EOL> properties = self . response . get_context ( ) <EOL> num_props = len ( properties ) <EOL> vdebug . log . Log ( "<STR_LIT>" % num_props , vdebug . log . Logger . INFO ) <EOL> for idx , prop in enumerate ( properties ) : <EOL> final = False <EOL> try : <EOL> next_prop = properties [ idx + <NUM_LIT:1> ] <EOL> except IndexError : <EOL> final = True <EOL> next_prop = None <EOL> res += self . __render_property ( prop , next_prop , final , indent ) <EOL> vdebug . log . Log ( "<STR_LIT>" + res , vdebug . log . Logger . DEBUG ) <EOL> return res <EOL> def __create_tabs ( self ) : <EOL> res = [ ] <EOL> if self . contexts : <EOL> for id , name in self . contexts . iteritems ( ) : <EOL> if self . current_context == id : <EOL> name = "<STR_LIT:*>" + name <EOL> res . append ( "<STR_LIT>" % name ) <EOL> if res : <EOL> return "<STR_LIT:U+0020>" . join ( res ) + "<STR_LIT>" <EOL> else : <EOL> return "<STR_LIT>" <EOL> def __render_property ( self , p , next_p , last = False , indent = <NUM_LIT:0> ) : <EOL> line = "<STR_LIT>" % { '<STR_LIT>' : "<STR_LIT>" . rjust ( ( p . depth * <NUM_LIT:2> ) + indent ) , '<STR_LIT>' : self . __get_marker ( p ) , '<STR_LIT:name>' : p . display_name . encode ( '<STR_LIT>' ) , '<STR_LIT:type>' : p . type_and_size ( ) , '<STR_LIT:value>' : "<STR_LIT:U+0020>" + p . value } <EOL> line = line . rstrip ( ) + "<STR_LIT:\n>" <EOL> if vdebug . opts . Options . get ( '<STR_LIT>' ) == '<STR_LIT>' : <EOL> depth = p . depth <EOL> if next_p and not last : <EOL> next_depth = next_p . depth <EOL> if depth == next_depth : <EOL> next_sep = "<STR_LIT:|>" <EOL> num_spaces = depth * <NUM_LIT:2> <EOL> elif depth > next_depth : <EOL> if not p . is_last_child : <EOL> line += "<STR_LIT>" . rjust ( depth * <NUM_LIT:2> + indent ) + "<STR_LIT>" <EOL> line += "<STR_LIT>" . rjust ( depth * <NUM_LIT:2> + indent ) + "<STR_LIT>" <EOL> next_sep = "<STR_LIT:/>" <EOL> num_spaces = ( depth * <NUM_LIT:2> ) - <NUM_LIT:1> <EOL> else : <EOL> next_sep = "<STR_LIT:\\>" <EOL> num_spaces = ( depth * <NUM_LIT:2> ) + <NUM_LIT:1> <EOL> line += "<STR_LIT>" . rjust ( num_spaces + indent ) + "<STR_LIT:U+0020>" + next_sep + "<STR_LIT:\n>" <EOL> elif depth > <NUM_LIT:0> : <EOL> if not p . is_last_child : <EOL> line += "<STR_LIT>" . rjust ( depth * <NUM_LIT:2> + indent ) + "<STR_LIT>" <EOL> line += "<STR_LIT>" . rjust ( depth * <NUM_LIT:2> + indent ) + "<STR_LIT>" <EOL> line += "<STR_LIT>" . rjust ( ( depth * <NUM_LIT:2> ) - <NUM_LIT:1> + indent ) + "<STR_LIT>" + "<STR_LIT:\n>" <EOL> return line <EOL> def __get_marker ( self , property ) : <EOL> char = vdebug . opts . Options . get ( '<STR_LIT>' ) <EOL> if property . has_children : <EOL> if property . child_count ( ) == <NUM_LIT:0> : <EOL> char = vdebug . opts . Options . get ( '<STR_LIT>' ) <EOL> else : <EOL> char = vdebug . opts . Options . get ( '<STR_LIT>' ) <EOL> return char </s>
