aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2013-01-28 22:17:57 +0100
committerAndré Erdmann <dywi@mailerd.de>2013-01-29 00:37:04 +0100
commit354e0fc4600dfc235eda6d26fda48c4cc75e9905 (patch)
treec870e3df4b47f00a6ef545674620659cae12c9cb
parentroverlay/overlay: pass parent to PackageDir (diff)
downloadR_overlay-354e0fc4600dfc235eda6d26fda48c4cc75e9905.tar.gz
R_overlay-354e0fc4600dfc235eda6d26fda48c4cc75e9905.tar.bz2
R_overlay-354e0fc4600dfc235eda6d26fda48c4cc75e9905.zip
roverlay/strutil.py: split_whitespace() function
-rw-r--r--roverlay/strutil.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/roverlay/strutil.py b/roverlay/strutil.py
index 4bf3584..4a5ef5d 100644
--- a/roverlay/strutil.py
+++ b/roverlay/strutil.py
@@ -7,7 +7,7 @@
"""provides utility functions for string manipulation"""
__all__ = [ 'ascii_filter', 'bytes_try_decode', 'fix_ebuild_name',
- 'pipe_lines', 'shorten_str', 'unquote'
+ 'pipe_lines', 'shorten_str', 'unquote', 'split_whitespace',
]
import re
@@ -17,6 +17,12 @@ _DEFAULT_ENCODINGS = ( 'utf-8', 'ascii', 'iso8859_15', 'utf-16', 'latin_1' )
_EBUILD_NAME_ILLEGAL_CHARS = re.compile ( "[.:]{1,}" )
_EBUILD_NAME_ILLEGAL_CHARS_REPLACE_BY = '_'
+_WHITESPACE = re.compile ( '\s+' )
+
+def split_whitespace ( _str, **kwargs ):
+ return _WHITESPACE.split ( _str, **kwargs )
+# --- end of split_whitespace (...) ---
+
def fix_ebuild_name ( name ):
"""Removes illegal chars from an ebuild name by replacing them with an
underscore char '_'.