stripMedia->strip

This commit is contained in:
Damien Elmes 2011-03-25 10:14:48 +09:00
parent 15737959f5
commit cc9f5b8d86
2 changed files with 2 additions and 2 deletions

View file

@ -97,7 +97,7 @@ If the same name exists, compare checksums."""
l.append(fname)
return l
def stripMedia(self, txt):
def strip(self, txt):
for reg in self.regexps:
txt = re.sub(reg, "", txt)
return txt

View file

@ -29,7 +29,7 @@ def test_strings():
assert mf("aoeu<img src=\"foo.jpg\"><img class=yo src=fo>ao") == [
"foo.jpg", "fo"]
assert mf("aou[sound:foo.mp3]aou") == ["foo.mp3"]
sp = d.media.stripMedia
sp = d.media.strip
assert sp("aoeu") == "aoeu"
assert sp("aoeu[sound:foo.mp3]aoeu") == "aoeuaoeu"
assert sp("a<img src=yo>oeu") == "aoeu"