summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/helper.py')
-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