[pve-devel] [PATCH v1 pve-esxi-import-tools 4/5] listvms: add arg parser, context manager for connections, fetch helper

Lukas Wagner l.wagner at proxmox.com
Wed Mar 20 10:39:07 CET 2024



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




More information about the pve-devel mailing list