Changeset 101:b90f8ec41870
- Timestamp:
- 05/29/07 18:44:24 (20 months ago)
- Author:
- Tarek Ziad?? <tarek@…>
- Message:
-
right encodings
- Location:
- atomisator
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r92
|
r101
|
|
| 32 | 32 | """ |
| 33 | 33 | content = entry['content'] |
| | 34 | if content == '': |
| | 35 | return False |
| | 36 | |
| 34 | 37 | for stored_entry in entries.select_entries(): |
| 35 | 38 | if ratio(content, stored_entry.content) > 0.7: |
| 36 | 39 | return False |
| | 40 | |
| 37 | 41 | return True |
| 38 | 42 | |
-
|
r100
|
r101
|
|
| 45 | 45 | |
| 46 | 46 | def detag(m): |
| 47 | | return '' |
| | 47 | return u'' |
| 48 | 48 | |
| 49 | 49 | exprs = ((entities, descape_entity), (tags, detag)) |
| 50 | 50 | |
| 51 | 51 | def descape(entry, entries): |
| | 52 | |
| 52 | 53 | for expr, func in exprs: |
| 53 | 54 | if 'title' in entry.keys(): |
| 54 | 55 | entry['title'] = expr.sub(func, entry['title']) |
| 55 | 56 | entry['content'] = expr.sub(func, entry['content']) |
| | 57 | |
| 56 | 58 | return True |
| 57 | 59 | |
-
|
r92
|
r101
|
|
| 50 | 50 | entry['content'] = u'' |
| 51 | 51 | |
| | 52 | if isinstance(entry['content'], str): |
| | 53 | entry['content'] = u'' |
| | 54 | |
| 52 | 55 | return entries |
| 53 | 56 | |