Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: flux-framework/flux-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 23553b2d73c01263d05fd1385101f93c89f24976
Choose a base ref
..
head repository: flux-framework/flux-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 444ee9214ba172e6bfc2a5c9b84150f5f098f921
Choose a head ref
Showing with 4 additions and 4 deletions.
  1. +1 −1 doc/man1/flux-jobs.rst
  2. +3 −3 src/bindings/python/flux/util.py
2 changes: 1 addition & 1 deletion doc/man1/flux-jobs.rst
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ string, "0s", "0.0", "0:00:00", or epoch time to a hyphen. For example, normally
By specifying, "{nodelist:h}", a hyphen would be presented instead.

The special presentation type *W* can be used to adjust output alignment
for wide characters. It only works with left/right alignment formating
for wide characters. It only works with left/right alignment formatting
of the form "(<|>)N", for example ``{id.emoji:>12W}``. It is used almost
exclusively for emoji based outputs.
6 changes: 3 additions & 3 deletions src/bindings/python/flux/util.py
Original file line number Diff line number Diff line change
@@ -450,17 +450,17 @@ def format_field(self, value, spec):
value = "-" if str(value) in basecases else str(value)
spec = spec[:-1] + "s"

if spec.endswith("W") and isinstance (value, str):
if spec.endswith("W") and isinstance(value, str):
match = re.search(r"^([<>])(\d+)W", spec)
if match:
align = match[1]
width = int(match[2])
widecount = 0
for chr in value:
if unicodedata.east_asian_width(chr) == 'W':
if unicodedata.east_asian_width(chr) == "W":
widecount += 1
if width > widecount:
width -= widecount;
width -= widecount
spec = f"{align}{width}s"
# if spec was not modified above, need to convert to "W"
# conversion to "s"