From 021068a8b7461a62ed4ce68ab558bc94786e0550 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 21 Jan 2021 12:25:46 +0100 Subject: mlog: add __len__ to AnsiDecorator --- mesonbuild/mlog.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mesonbuild/mlog.py') diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index 6207d98..a6aa2b5 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -130,6 +130,9 @@ class AnsiDecorator: text = '"{}"'.format(text) return text + def __len__(self) -> int: + return len(self.text) + def __str__(self) -> str: return self.get_text(colorize_console()) -- cgit v1.1