From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 76335138720 for ; Mon, 28 Jan 2013 23:54:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C3BB21C0C0; Mon, 28 Jan 2013 23:54:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DD77021C0C0 for ; Mon, 28 Jan 2013 23:54:13 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EA1B633DBB4 for ; Mon, 28 Jan 2013 23:54:07 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0D3F2E4090 for ; Mon, 28 Jan 2013 23:54:05 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1359416224.354e0fc4600dfc235eda6d26fda48c4cc75e9905.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/strutil.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 354e0fc4600dfc235eda6d26fda48c4cc75e9905 X-VCS-Branch: master Date: Mon, 28 Jan 2013 23:54:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 10311966-2076-4118-b078-9eb6139a6637 X-Archives-Hash: eb26281c1c93c4888fb3dc44ee1f6aa7 commit: 354e0fc4600dfc235eda6d26fda48c4cc75e9905 Author: André Erdmann mailerd de> AuthorDate: Mon Jan 28 21:17:57 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Jan 28 23:37:04 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=354e0fc4 roverlay/strutil.py: split_whitespace() function --- roverlay/strutil.py | 8 +++++++- 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 '_'.