comparison backend/sqlalchemy/SqlAlchemyBackend.py @ 121:510a5d00e98a backend

re-enabled AddFeed - does not work yet
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sun, 21 Aug 2011 04:17:13 +0200
parents 04a730f9d07d
children f5afe0c1f4d2
comparison
equal deleted inserted replaced
120:e830fa1cc7a2 121:510a5d00e98a
1 1
2 from Preferences import Preferences 2 from Preferences import Preferences
3 from FeedUpdater import FeedUpdater
3 import Database 4 import Database
4 import logging 5 import logging
5 import util 6 import util
6 import FeedList 7 import FeedList
7 8
12 13
13 def __init__(self): 14 def __init__(self):
14 self._initLogging() 15 self._initLogging()
15 self.session = Database.createSession() 16 self.session = Database.createSession()
16 self.prefs = Preferences(self.session) 17 self.prefs = Preferences(self.session)
18 self.updater = None
17 19
18 def _initLogging(self): 20 def _initLogging(self):
19 logging.getLogger("sqlalchemy.orm").setLevel(logging.WARN) 21 logging.getLogger("sqlalchemy.orm").setLevel(logging.WARN)
20 22
21 sqlalchemyLogLevel = logging.ERROR 23 sqlalchemyLogLevel = logging.ERROR
24 logging.getLogger("sqlalchemy").setLevel(sqlalchemyLogLevel) 26 logging.getLogger("sqlalchemy").setLevel(sqlalchemyLogLevel)
25 27
26 def preferences(self): 28 def preferences(self):
27 return self.prefs 29 return self.prefs
28 30
31 def feedUpdater(self):
32 if self.updater is None:
33 self.updater = FeedUpdater(self.session)
34 return self.updater
35
29 def getFeeds(self): 36 def getFeeds(self):
30 return FeedList.getFeeds(self.session) 37 return FeedList.getFeeds(self.session)
31 38
32 def dispose(self): 39 def dispose(self):
33 # save all uncommitted state, just in case 40 # save all uncommitted state, just in case