271 # | | X | | X | | |
271 # | | X | | X | | |
272 # | |/ / | |/ / |
272 # | |/ / | |/ / |
273 # | | | | | | |
273 # | | | | | | |
274 line.extend(echars[idx * 2:(idx + 1) * 2]) |
274 line.extend(echars[idx * 2:(idx + 1) * 2]) |
275 else: |
275 else: |
276 line.extend(' ') |
276 line.extend([' ', ' ']) |
277 # all edges to the right of the current node |
277 # all edges to the right of the current node |
278 remainder = ncols - idx - 1 |
278 remainder = ncols - idx - 1 |
279 if remainder > 0: |
279 if remainder > 0: |
280 line.extend(echars[-(remainder * 2):]) |
280 line.extend(echars[-(remainder * 2):]) |
281 return line |
281 return line |
408 state['lastcoldiff'], fix_nodeline_tail)) |
408 state['lastcoldiff'], fix_nodeline_tail)) |
409 |
409 |
410 # shift_interline is the line containing the non-vertical |
410 # shift_interline is the line containing the non-vertical |
411 # edges between this entry and the next |
411 # edges between this entry and the next |
412 shift_interline = echars[:idx * 2] |
412 shift_interline = echars[:idx * 2] |
413 shift_interline.extend(' ' * (2 + coldiff)) |
413 for i in xrange(2 + coldiff): |
|
414 shift_interline.append(' ') |
414 count = ncols - idx - 1 |
415 count = ncols - idx - 1 |
415 if coldiff == -1: |
416 if coldiff == -1: |
416 shift_interline.extend('/ ' * count) |
417 for i in xrange(count): |
|
418 shift_interline.extend(['/', ' ']) |
417 elif coldiff == 0: |
419 elif coldiff == 0: |
418 shift_interline.extend(echars[(idx + 1) * 2:ncols * 2]) |
420 shift_interline.extend(echars[(idx + 1) * 2:ncols * 2]) |
419 else: |
421 else: |
420 shift_interline.extend(r'\ ' * count) |
422 for i in xrange(count): |
|
423 shift_interline.extend(['\\', ' ']) |
421 |
424 |
422 # draw edges from the current node to its parents |
425 # draw edges from the current node to its parents |
423 _drawedges(echars, edges, nodeline, shift_interline) |
426 _drawedges(echars, edges, nodeline, shift_interline) |
424 |
427 |
425 # lines is the list of all graph lines to print |
428 # lines is the list of all graph lines to print |