public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/metadata/
Date: Thu, 25 Apr 2013 16:44:17 +0000 (UTC)	[thread overview]
Message-ID: <1363536390.37357f6a8b38332a3d061a38f6fb14484aa46eaf.dywi@gentoo> (raw)

commit:     37357f6a8b38332a3d061a38f6fb14484aa46eaf
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Sun Mar 17 15:17:59 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Sun Mar 17 16:06:30 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=37357f6a

overlay/pkgdir/metadata: use additional_filter

Pass a filter function to strutil.ascii_filter() instead of editing the
value string twice.

---
 roverlay/overlay/pkgdir/metadata/abstractnodes.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/roverlay/overlay/pkgdir/metadata/abstractnodes.py b/roverlay/overlay/pkgdir/metadata/abstractnodes.py
index 2cb67ca..465973a 100644
--- a/roverlay/overlay/pkgdir/metadata/abstractnodes.py
+++ b/roverlay/overlay/pkgdir/metadata/abstractnodes.py
@@ -16,7 +16,7 @@ __all__ = [ 'MetadataLeaf', 'MetadataNode',
 ]
 
 from roverlay import strutil
-import re
+
 import textwrap
 
 INDENT = '\t'
@@ -211,11 +211,15 @@ class MetadataLeaf ( _MetadataBasicNode ):
 
 	def _default_value_str ( self ):
 		"""Returns the value string. Derived classes may override this."""
+		def char_allowed ( c ):
+			return c not in self.__class__.INVALID_CHARS
+		# --- end of char_allowed (...) ---
+
 		#if self.value_format == ?: format value ~
-		return re.sub (
-			"[" + self.__class__.INVALID_CHARS + "]",
-			'',
-			strutil.ascii_filter ( str ( self.value ) )
+
+		return strutil.ascii_filter (
+				str ( self.value ),
+				additional_filter = char_allowed
 		)
 	# --- end of _value_str (...) ---
 


             reply	other threads:[~2013-04-25 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-25 16:44 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-04-25 16:44 [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/metadata/ André Erdmann
2013-09-05 16:01 André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363536390.37357f6a8b38332a3d061a38f6fb14484aa46eaf.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox