Skip to content

Commit

Permalink
Improve "progress bar" pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Feb 12, 2024
1 parent 6b4d20e commit e10bcc3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion diff-logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
r'(?:[\da-fA-F]{4,}-){4,}[\da-fA-F]{4,}': '106d1ff-106d-1ff1-06d1-ff106d1ff', # UUID
r'[a-zA-Z0-9]{18,}': 'AAAAAAAAAAAAAAAAAA', # Long payload
r'[a-fA-F0-9]{7,}': '106D1FF', # Hash digest
r'━━━━+': '━━━━', # Progress bar
# Progress bar, e.g. in pip, tqdm
r'^(?P<indent>[ \t]*)(?P<pct>\d+%\|)?'
r'(?P<symbol>[━=█])(?P=symbol){4,}(?(pct)\||)'
r'([ \d.,:/\][<]|(MB|kB|B|it)(:?/s)?|eta)*': '\g<indent>━━━━━',
}

assert all(re.match(fr'\A(?:{p})\Z', v)
Expand Down

0 comments on commit e10bcc3

Please sign in to comment.