summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
authornecoro <>2007-03-31 19:29:26 +0000
committernecoro <>2007-03-31 19:29:26 +0000
commit2d2f6823f5360a5287b4b19d035cad4a5611fa3a (patch)
treec108aee3dd9a34c1c7dbc68ed87ff4cc65078593 /portato/helper.py
parent5138b1e23d34e0a72e0c2f4ae52256e14d825320 (diff)
downloadportato-2d2f6823f5360a5287b4b19d035cad4a5611fa3a.tar.gz
portato-2d2f6823f5360a5287b4b19d035cad4a5611fa3a.tar.bz2
portato-2d2f6823f5360a5287b4b19d035cad4a5611fa3a.zip
Allowed Plugins to have a menu
Diffstat (limited to '')
-rw-r--r--portato/helper.py12
1 files changed, 12 insertions, 0 deletions
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 <necoro@necoro.net> 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