Support for (gu)id

master
pictuga 2013-10-12 23:36:00 +02:00
parent e98617c320
commit 0d1f1fdcc0
1 changed files with 38 additions and 0 deletions

View File

@ -418,6 +418,16 @@ class FeedItem(FeedBase):
self.content = "" self.content = ""
def getId(self):
return ""
def setId(self, value):
pass
def delId(self):
self.id = ""
def getTime(self): def getTime(self):
return None return None
@ -441,6 +451,7 @@ class FeedItem(FeedBase):
link = FeedDescriptor('link') link = FeedDescriptor('link')
description = desc = FeedDescriptor('desc') description = desc = FeedDescriptor('desc')
content = FeedDescriptor('content') content = FeedDescriptor('content')
id = FeedDescriptor('id')
time = FeedTime('time') time = FeedTime('time')
updated = FeedTime('updated') updated = FeedTime('updated')
@ -507,6 +518,19 @@ class FeedItemRSS(FeedItem):
element.text = value element.text = value
def getId(self):
return self.xval('rssfake:guid|guid')
def setId(self, value):
if not value:
return self.xdel('rssfake:guid|guid')
table = { 'rdf:rdf': 'rssfake:guid',
'channel': 'guid'}
element = self.xgetCreate(table)
element.text = value
def getTime(self): def getTime(self):
return self.xval('rssfake:pubDate|pubDate') return self.xval('rssfake:pubDate|pubDate')
@ -587,6 +611,20 @@ class FeedItemAtom(FeedItem):
element.attrib['type'] = 'html' element.attrib['type'] = 'html'
element.text = value element.text = value
def getId(self):
return self.xval('atom:id|atom03:id')
def setId(self, value):
if not value:
return self.xdel('atom:id|atom03:id')
table = { 'atom:feed': 'atom:id',
'atom03:feed': 'atom03:id'}
element = self.xgetCreate(table)
element.text = value
def getTime(self): def getTime(self):
return self.xval('atom:published|atom03:published') return self.xval('atom:published|atom03:published')