From 573ff92a8513314b05c1e25c019a30619e2a2474 Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Tue, 19 Mar 2019 18:15:39 +0400 Subject: [PATCH] interactive: list_spi: Accept and split string as first argument Use case: to show info on all packages in your clipboard, do: >>> list_spi(''' ... ... ''') --- port_stats/interactive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/port_stats/interactive.py b/port_stats/interactive.py index b3e3318..8182eb6 100644 --- a/port_stats/interactive.py +++ b/port_stats/interactive.py @@ -170,6 +170,8 @@ g = gspi # noqa def list_spi(pkgs, colors=None, to=print): + if isinstance(pkgs, basestring): + pkgs = pkgs.split() pset = frozenset(pkgs) lines = _spi_by_predicate(pset.__contains__, colors) unknown = pset - frozenset(BY_NAME)