From 2d2f6823f5360a5287b4b19d035cad4a5611fa3a Mon Sep 17 00:00:00 2001 From: necoro <> Date: Sat, 31 Mar 2007 19:29:26 +0000 Subject: Allowed Plugins to have a menu --- portato/helper.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'portato/helper.py') diff --git a/portato/helper.py b/portato/helper.py index b41dbbe..604f2c1 100644 --- a/portato/helper.py +++ b/portato/helper.py @@ -11,6 +11,8 @@ # Written by René 'Necoro' Neumann et.al. import traceback, os.path, sys +from itertools import chain + DEBUG = True @@ -77,6 +79,16 @@ def am_i_root (): else: return False +def flatten (listOfLists): + """Flattens the given list of lists. + + @param listOfLists: the list of lists to flatten + @type listOfLists: list of lists + @returns: flattend list + @rtyoe: list""" + + return list(chain(*listOfLists)) + def unique_array(s): """Stolen from portage_utils: lifted from python cookbook, credit: Tim Peters -- cgit v1.2.3