[virt-tools-list] [PATCH] inspection: try harder to show a pkg summary

Richard W.M. Jones rjones at redhat.com
Mon Feb 27 18:28:03 UTC 2017


On Mon, Feb 27, 2017 at 11:29:45AM +0100, Pino Toscano wrote:
> If a package has no summary, try to use the description (if available):
> - if it is just one line (mostly because the package manager only has
>   a single line as description of a package), then use it fully
> - if it contains more lines, then take the first only, adding suspension
>   dots to indicate it is longer than that
> ---
>  virtManager/details.py | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/virtManager/details.py b/virtManager/details.py
> index 3b0b480..9960d99 100644
> --- a/virtManager/details.py
> +++ b/virtManager/details.py
> @@ -2436,6 +2436,13 @@ class vmmDetails(vmmGObjectUI):
>                  summary = ""
>                  if app["app_summary"]:
>                      summary = app["app_summary"]
> +                elif app["app_description"]:
> +                    summary = app["app_description"]
> +                    pos = summary.find("\n")
> +                    if pos > -1:
> +                        summary = _("%(summary)s ...") % {
> +                            "summary" : summary[0:pos]
> +                        }
>  
>                  apps_model.append([name, version, summary])

Looks good, ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the virt-tools-list mailing list