From f2b0f5db230e8fdfec3f5fa0fcc53766582daf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 7 Apr 2009 23:48:55 +0200 Subject: Removed the obsolete single unittest and the unique_array function --- portato/helper.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'portato/helper.py') diff --git a/portato/helper.py b/portato/helper.py index 1861ae6..d271611 100644 --- a/portato/helper.py +++ b/portato/helper.py @@ -115,41 +115,6 @@ def flatten (listOfLists): return ret -def unique_array(s): - """Stolen from portage_utils: - lifted from python cookbook, credit: Tim Peters - Return a list of the elements in s in arbitrary order, sans duplicates""" - # assume all elements are hashable, if so, it's linear - try: - return list(set(s)) - except TypeError: - pass - - # so much for linear. abuse sort. - try: - t = list(s) - t.sort() - except TypeError: - pass - else: - n = len(s) - assert n > 0 - last = t[0] - lasti = i = 1 - while i < n: - if t[i] != last: - t[lasti] = last = t[i] - lasti += 1 - i += 1 - return t[:lasti] - - # blah. back to original portage.unique_array - u = [] - for x in s: - if x not in u: - u.append(x) - return u - def detect_desktop_environment(): # stolen from wicd :) -- cgit v1.2.3