2 import feedparser
, sqlite3
5 def __init__( self
, cursor
):
11 for row
in cursor
.execute( "select * from category" ):
12 self
.category
[ row
["id"] ] = { "id": row
["id"], "name": row
["name"], "parent": row
["parent"], "feeds": [] }
14 for row
in cursor
.execute( "select * from tag" ):
15 self
.tag
[ row
["id"] ] = { "id": row
["id"], "name": row
["name"], "entries": [] }
17 for row
in cursor
.execute( "select * from feed" ):
18 self
.feed
[ row
["id"] ] = { "id": row
["id"], "title": row
["title"], "entries": [] }
19 self
.category
[ row
["category"] ]["feeds"].append( row
["id"] )
21 for row
in cursor
.execute( "select id, feed, sha1, status, stamp, title, author from entry" ):
22 self
.entry
[ row
["id"] ] = { "id": row
["id"], "status": row
["status"], "stamp": row
["stamp"], "title": row
["title"], "author": row
["author"], "content": "" }
23 self
.feed
[ row
["feed"] ]["entries"].append( row
["id"] )
25 for row
in cursor
.execute( "select * from tagged" ):
26 self
.tag
[ row
["tag"] ]["entries"].append( row
["entry"] )