equal
deleted
inserted
replaced
22 import util, encoding |
22 import util, encoding |
23 from i18n import _ |
23 from i18n import _ |
24 |
24 |
25 |
25 |
26 def replace(text, substs): |
26 def replace(text, substs): |
27 utext = text.decode(encoding.encoding) |
|
28 for f, t in substs: |
27 for f, t in substs: |
29 utext = utext.replace(f, t) |
28 text = text.replace(f, t) |
30 return utext.encode(encoding.encoding) |
29 return text |
31 |
|
32 |
30 |
33 _blockre = re.compile(r"\n(?:\s*\n)+") |
31 _blockre = re.compile(r"\n(?:\s*\n)+") |
34 |
32 |
35 def findblocks(text): |
33 def findblocks(text): |
36 """Find continuous blocks of lines in text. |
34 """Find continuous blocks of lines in text. |