From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1SqnyX-00011h-7F for garchives@archives.gentoo.org; Mon, 16 Jul 2012 16:16:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3A053E074B; Mon, 16 Jul 2012 16:15:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 07B9BE074B for ; Mon, 16 Jul 2012 16:15:52 +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 2B0541B409E for ; Mon, 16 Jul 2012 16:15:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id DD5F0E5459 for ; Mon, 16 Jul 2012 16:15:47 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1342454627.35073605819b2238010a284da4678d31509ab191.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/util.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 35073605819b2238010a284da4678d31509ab191 X-VCS-Branch: master Date: Mon, 16 Jul 2012 16:15:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 03331367-e860-46d7-bc72-09a9fb5d4f81 X-Archives-Hash: 6a3c4ba8ab2e9c40892bb47777bf7894 commit: 35073605819b2238010a284da4678d31509ab191 Author: Andr=C3=A9 Erdmann mailerd de> AuthorDate: Mon Jul 16 16:03:47 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Mon Jul 16 16:03:47 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3D35073605 util: function to remove non-ascii chars --- roverlay/util.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/roverlay/util.py b/roverlay/util.py index d658b15..2df4845 100644 --- a/roverlay/util.py +++ b/roverlay/util.py @@ -21,6 +21,11 @@ def fix_ebuild_name ( name ): ) # --- end of fix_ebuild_name (...) --- =20 +def ascii_filter ( _str ): + """Removes all non-ascii chars from a string and returns the result.""" + return ''.join ( c for c in _str if ord ( c ) < 128 ) +# --- end of ascii_filter (...) --- + def shorten_str ( s, maxlen, replace_end=3DNone ): if not replace_end is None: rlen =3D maxlen - len ( replace_end )