6 |
import straw |
import straw |
7 |
import re |
import re |
8 |
import error |
import error |
9 |
|
import string |
10 |
|
|
11 |
iso_date_re = re.compile('^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d') |
iso_date_re = re.compile('^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d') |
12 |
|
|
91 |
|
|
92 |
item.description, enc = unicode_field(idict, 'description', enc = enc) |
item.description, enc = unicode_field(idict, 'description', enc = enc) |
93 |
|
|
94 |
|
# dc:creator |
95 |
|
if idict.has_key('creator'): |
96 |
|
item.creator, enc = unicode_field(idict, 'creator', enc=enc) |
97 |
|
|
98 |
# content_encoded |
# content_encoded |
99 |
if idict.has_key('content_encoded'): |
if idict.has_key('content_encoded'): |
100 |
ce, enc = unicode_field(idict, 'content_encoded', enc = enc) |
ce, enc = unicode_field(idict, 'content_encoded', enc = enc) |
104 |
item.guid, enc = unicode_field(idict, 'guid', enc = enc) |
item.guid, enc = unicode_field(idict, 'guid', enc = enc) |
105 |
item.pub_date = read_date(idict.get('date', "")) |
item.pub_date = read_date(idict.get('date', "")) |
106 |
|
|
107 |
if idict.has_key('source_url'): |
if idict.has_key('source'): |
108 |
st, enc = unicode_field(idict, 'source', '', enc = enc) |
st, enc = unicode_field(idict, 'source', enc = enc) |
109 |
item.source = {'url': idict['source_url'].strip(), 'text': st} |
# source format: "url,name" e.g. 'http://blah.foo,BlahFoo' |
110 |
|
url, text = string.split(st, ',') |
111 |
|
item.source = {'url': url.strip(), 'text': text} |
112 |
|
|
113 |
if item.description is not None: |
if item.description is not None: |
114 |
idh = SummaryParserCommon.ItemDescriptionHandler(feed) |
idh = SummaryParserCommon.ItemDescriptionHandler(feed) |