On  2024-03-19 16:32, Max Carrara wrote:

> +    def _squeeze_and_wrap(text: str) -> str:
> +        """Makes it easier to write help text using multiline strings."""
> +
> +        text = text.replace("\n", " ").strip()
> +
> +        # squeeze recurring spaces
> +        while "  " in text:
> +            text = text.replace("  ", " ")
> +

How about `" ".join(text.split())`? :)

-- 
- Lukas


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to