File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,7 @@ def align_bars(bars, align_inside_bars_too=True):
160
160
161
161
def align_bar_separators (bar_seps ):
162
162
bar_seps = [' %s ' % bs .strip () for bs in bar_seps ]
163
- if any (':|' in bs for bs in bar_seps ):
164
- just_func = string .rjust
165
- else :
166
- just_func = string .ljust
163
+ use_rjust = any (':|' in bs for bs in bar_seps )
167
164
168
165
if any ('|' in bs for bs in bar_seps ):
169
166
# try to center around the last occurance of '|'
@@ -176,7 +173,10 @@ def align_bar_separators(bar_seps):
176
173
return [b .ljust (max_len ) for b in bar_seps ]
177
174
else :
178
175
max_len = max (len (b ) for b in bar_seps )
179
- return [just_func (b , max_len ) for b in bar_seps ]
176
+ if use_rjust :
177
+ return [b .rjust (max_len ) for b in bar_seps ]
178
+ else :
179
+ return [b .ljust (max_len ) for b in bar_seps ]
180
180
181
181
def split_line_into_parts (line ):
182
182
parts = bar_sep .split (line )
You can’t perform that action at this time.
0 commit comments