Changeset 605
- Timestamp:
- 07/08/03 15:17:39 (5 years ago)
- Files:
-
- trunk/RBFoundation/RBFoundation/Utilities.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/RBFoundation/RBFoundation/Utilities.py
r551 r605 56 56 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 57 58 def flatten(collection, level=1): 59 if isIterable(collection): 60 if level: 61 return [each for item in collection for each in flatten(item, level-1)] 62 else: 63 return collection 64 else: 65 return [collection] 66 67 def flattenall(collection): 68 return flatten(collection, -1) 69 58 70 def cleanupstrlst(datalst, FilterResult=0): 59 71 """Strips characters from a list of strings, and drops subsequent empty strings.
