Example #1
0
File: ui.py Project: Lanka/feedIO
    def closeEvent(self, event):
        print "marking all new Items as old before exit"
        newItems = fm.listNew()
        for item in newItems:
            fm.setItemFlag(item, 1, False)
            print "marked %s new to unread" % item.title

        # Might need to move this commit to a better place.
        # this is done to ruduce the number of commites to be performed when exiting, to one
        fm.session.commit()
        event.accept()
Example #2
0
File: ui.py Project: Lanka/feedIO
    def addFeed(self):
        feedUrl = unicode(self.ui.UrlLineEdit.text())

        thread = threading.Thread(target=fm.addFeed, args=(feedUrl,))
        thread.setDaemon(True)
        thread.start()

        thread.join()

        itemList = fm.listNew()
        classifier.assignToAllTopics(itemList)
        self.parent.parent.setNewItemScores()
        self.close()
Example #3
0
    def addFeed(self):
        feedUrl = unicode(self.ui.UrlLineEdit.text())

        thread = threading.Thread(target=self.parent.parent.addFeed, args=(feedUrl,))
        thread.setDaemon(True)
        thread.start()
        thread.join()

        if self.parent.parent.refreshDisplay is True:
            itemList = fm.listNew()
            classifier.assignItemsToTopics(itemList)
            self.parent.parent.setNewItemScores()
            self.parent.displayFeeds()
        self.close()
Example #4
0
File: ui.py Project: Lanka/feedIO
    def addFeed(self):
        feedUrl = unicode(self.ui.urlLine.text())
        #Run the addFeed function in a new thread so that the ui is responsive.
        thread = threading.Thread(target=fm.addFeed, args=(feedUrl,))
        thread.setDaemon(True)
        thread.start()
        thread.join()

        itemList = fm.listNew()
        classifier.assignToAllTopics(itemList)
        self.parent.parent.setNewItemScores()

        self.ui.urlLine.clear()
        self.displayFeeds()
Example #5
0
File: ui.py Project: seejay/feedIO
    def addFeed(self):
        feedUrl = unicode(self.ui.UrlLineEdit.text())

        thread = threading.Thread(target=self.parent.parent.addFeed, args=(feedUrl,))
        thread.setDaemon(True)
        thread.start()
        thread.join()

        if self.parent.parent.refreshDisplay is True:
            itemList = fm.listNew()
            classifier.assignItemsToTopics(itemList)
            self.parent.parent.setNewItemScores()
            self.parent.displayFeeds()
        self.close()
Example #6
0
    def fetchAll(self):
        self.status = "fetching Updates..."
        self.sendNotification()
        fm.updateAll()

        #assign the newly fetched articles to the topics
        newList = fm.listNew()
        classifier.assignItemsToTopics(newList)
        print "Assigned the new articles to topics"
        #calculate the priority scores of the new articles for each topic.
        self.setNewItemScores()

        self.status = "All feeds updated."
        print self.status
        self.sendNotification()
Example #7
0
    def fetchAll(self):
        self.status = "fetching Updates..."
        self.sendNotification()
        fm.updateAll()

        #assign the newly fetched articles to the topics
        newList = fm.listNew()
        classifier.assignItemsToTopics(newList)
        print "Assigned the new articles to topics"
        #calculate the priority scores of the new articles for each topic.
        self.setNewItemScores()

        self.status = "All feeds updated."
        print self.status
        self.sendNotification()
Example #8
0
File: ui.py Project: seejay/feedIO
    def addFeed(self):
        feedUrl = unicode(self.ui.urlLine.text())
        #Run the addFeed function in a new thread so that the ui is responsive.
        thread = threading.Thread(target=self.parent.parent.addFeed, args=(feedUrl,))
        thread.setDaemon(True)
        thread.start()
        thread.join()

        if self.parent.parent.refreshDisplay is True:
            itemList = fm.listNew()
            classifier.assignItemsToTopics(itemList)
            self.parent.parent.setNewItemScores()

            self.ui.urlLine.clear()
            self.displayFeeds()
Example #9
0
    def closeEvent(self, event):
        print "marking all new Items as old before exit"
        newItems = fm.listNew()
        for item in newItems:
            fm.setItemFlag(item, 1, False)
            print "marked %s new to unread" % item.title

        #check whether text to speech is still working
        if (self.playerState == 'playing'):
            self.sp.stop()
            self.playerState='standby'
            print "speech engine terminated on exit"
        else:
            pass

        # Might need to move this commit to a better place.
        # this is done to ruduce the number of commites to be performed when exiting, to one
        fm.session.commit()
        event.accept()
Example #10
0
    def closeEvent(self, event):
        print "marking all new Items as old before exit"
        newItems = fm.listNew()
        for item in newItems:
            fm.setItemFlag(item, 1, False)
            print "marked %s new to unread" % item.title

        #check whether text to speech is still working
        if (self.playerState == 'playing'):
            self.sp.stop()
            self.playerState = 'standby'
            print "speech engine terminated on exit"
        else:
            pass

        # Might need to move this commit to a better place.
        # this is done to ruduce the number of commites to be performed when exiting, to one
        fm.session.commit()
        event.accept()