updatingFeeds = []
#commands = [("addFeed","httpwww"), ("openFeed", "xxxx"), ("openArticle", ("feedid","artid"))]
-commands = [("openFeed", "1,", "61ac1458d761423344998dc76770e36e")]
+commands = []
def unescape(text):
def fixup(m):
self.keys = keys
def run (self):
+ updateDbusHandler.UpdateStarted()
for key in self.keys:
print "Start update: %s" % key
updatingFeeds.append(key)
print "Error updating feed: %s" %key
updatingFeeds.remove(key)
print "End update: %s" % key
+ updateDbusHandler.UpdateFinished()
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def openTaskSwitch(self):
import subprocess
subprocess.Popen("dbus-send /com/nokia/hildon_desktop com.nokia.hildon_desktop.exit_app_view", shell=True)
- def updateAll(self):
- import subprocess
- subprocess.Popen("FeedingIt update", shell=True)
+ def automaticUpdate(self):
+ feeds = []
+ for cat in listing.getListOfCategories():
+ for feed in listing.getSortedListOfKeys("Manual", category=cat):
+ feeds.append(feed)
+ print feeds
+ download = Download(listing, feeds)
+ download.start()
def getCommands(self):
if markAllAsRead=="True":
feed.markAllAsRead()
listing.updateUnread(key)
+ updateDbusHandler.ArticleCountUpdated()
xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><xml>"
if onlyUnread == "False":
onlyUnread = False
feed = listing.getFeed(key)
feed.setEntryRead(article)
listing.updateUnread(key)
+ updateDbusHandler.ArticleCountUpdated()
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
download.start()
xml = "<xml>OK</xml>"
elif request[1]=="updateAll":
- feeds = []
- for cat in listing.getListOfCategories():
- for feed in listing.getSortedListOfKeys("Manual", category=cat):
- feeds.append(feed)
- print feeds
- download = Download(listing, feeds)
- download.start()
+ self.automaticUpdate()
+ updateDbusHandler.ArticleCountUpdated()
xml = "<xml>OK</xml>"
elif request[1] == "addCat":
catName = request[2]
thread.start_new_thread(start_server, ())
from feedingitdbus import ServerObject
-#from updatedbus import UpdateServerObject, get_lock
+from updatedbus import UpdateServerObject, get_lock
import gobject
gobject.threads_init()
import dbus.mainloop.glib
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
+app = App()
+dbusHandler = ServerObject(app)
+updateDbusHandler = UpdateServerObject(app)
mainloop = gobject.MainLoop()
mainloop.run()