|
|
|
|
@ -13,6 +13,7 @@ class Cache:
|
|
|
|
|
def __init__(self, api):
|
|
|
|
|
self.conn = None
|
|
|
|
|
self.api = api
|
|
|
|
|
file_path = os.path.expanduser("~") + '/.config/inomnibus/cache.db'
|
|
|
|
|
create_categories = """create table if not exists categories (
|
|
|
|
|
id text primary key,
|
|
|
|
|
name text not null,
|
|
|
|
|
@ -61,7 +62,7 @@ class Cache:
|
|
|
|
|
)
|
|
|
|
|
"""
|
|
|
|
|
try:
|
|
|
|
|
self.conn = sqlite3.connect(os.path.expanduser("~") + '/.config/inomnibus/cache.db')
|
|
|
|
|
self.conn = sqlite3.connect(file_path)
|
|
|
|
|
self.conn.cursor().execute(create_categories)
|
|
|
|
|
self.conn.cursor().execute(create_feeds)
|
|
|
|
|
self.conn.cursor().execute(create_articles)
|
|
|
|
|
@ -238,7 +239,7 @@ class Cache:
|
|
|
|
|
row[0],
|
|
|
|
|
count=str(row[2]),
|
|
|
|
|
timestamp=timestamp,
|
|
|
|
|
number=row[3])
|
|
|
|
|
number=str(row[3]))
|
|
|
|
|
for article in articles:
|
|
|
|
|
articleObj = Article(article)
|
|
|
|
|
cur.execute("""insert into articles(id,title,timestamp,date,content,url,is_read,origin,category_id)
|
|
|
|
|
|