Beispiel #1
0
 def openFeed(self, key):
     self.feedOpen = True
     try:
         parsed = feedparser.parse(self.feedList[key])
         try:
             self.p.printText('Last modified: ' + parsed.modified)
             modifiedTag = True
         except:
             modifiedTag = False
         feed = Slist(parsed.entries)
     except:
         self.p.printError(
             "Can't load feed, check your internet connection")
     while self.feedOpen == True:
         entry = feed.current()
         try:
             self.p.printLink(entry['title'], entry['title'] in self.viewed)
         except:
             self.p.printError('Unable to display title')
         command = ord(msvcrt.getch())
         if command == 224:
             arrow = ord(msvcrt.getch())
             if arrow == 80:
                 feed.next()
             if arrow == 75:
                 self.feedOpen = False
             elif arrow == 77:
                 self.openEntry(entry)
             elif arrow == 72:
                 feed.previous()
         elif command == 114:
             if modifiedTag:
                 updated = feedparser.parse(self.feedList[key],
                                            modified=parsed.modified)
                 if updated.status == 200:
                     feed = Slist(updated.entries)
                     self.p.printStatus('Feed Updated, Last Modified: ' +
                                        updated.modified)
                     parsed = updated
                 else:
                     self.p.printStatus('Feed is up to date')
             else:
                 updated = feedparser.parse(self.feedList[key])
                 feed = Slist(updated.entries)
                 self.p.printStatus('Feed refreshed')
                 parsed = updated
         elif command == 113 or command == 27:
             self.feedOpen = False
             self.browsing = False
             self.run = False
Beispiel #2
0
 def openFeed(self, key):
     self.feedOpen = True
     try:
         parsed = feedparser.parse(self.feedList[key])
         try:
             self.p.printText('Last modified: ' + parsed.modified)
             modifiedTag = True
         except:
             modifiedTag = False
         feed = Slist(parsed.entries)
     except:
         self.p.printError("Can't load feed, check your internet connection")
     while self.feedOpen == True:
         entry = feed.current()
         try:
             self.p.printLink(entry['title'], entry['title'] in self.viewed)
         except:
             self.p.printError('Unable to display title')
         command = ord(msvcrt.getch())
         if command == 224:
             arrow = ord(msvcrt.getch())
             if arrow == 80:
                 feed.next()
             if arrow == 75:
                 self.feedOpen = False
             elif arrow == 77:
                 self.openEntry(entry)
             elif arrow == 72:
                 feed.previous()
         elif command == 114:
             if modifiedTag:
                 updated=feedparser.parse(self.feedList[key],modified=parsed.modified)
                 if updated.status == 200:
                     feed = Slist(updated.entries)
                     self.p.printStatus('Feed Updated, Last Modified: ' + updated.modified)
                     parsed = updated
                 else:
                     self.p.printStatus('Feed is up to date')
             else:
                 updated=feedparser.parse(self.feedList[key])
                 feed = Slist(updated.entries)
                 self.p.printStatus('Feed refreshed')
                 parsed = updated
         elif command == 113 or command == 27:
             self.feedOpen = False
             self.browsing = False
             self.run = False
Beispiel #3
0
 def browse(self):
     feeds = Slist(self.feedList)
     self.browsing = True
     
     while self.browsing == True:
         self.p.printText(feeds.current())
             
         command = ord(msvcrt.getch())
         if command == 224:
             arrow = ord(msvcrt.getch())
             if arrow == 80:
                 feeds.next()
             elif arrow == 75:
                 self.browsing = False
             elif arrow == 77:
                 self.openFeed(feeds.current())
             elif arrow == 83:
                 self.removeFeed(feeds.current())
                 self.browse()
             elif arrow == 72:
                 feeds.previous()
         elif command == 113 or command == 27:
             self.browsing = False
             self.run = False
Beispiel #4
0
    def browse(self):
        feeds = Slist(self.feedList)
        self.browsing = True

        while self.browsing == True:
            self.p.printText(feeds.current())

            command = ord(msvcrt.getch())
            if command == 224:
                arrow = ord(msvcrt.getch())
                if arrow == 80:
                    feeds.next()
                elif arrow == 75:
                    self.browsing = False
                elif arrow == 77:
                    self.openFeed(feeds.current())
                elif arrow == 83:
                    self.removeFeed(feeds.current())
                    self.browse()
                elif arrow == 72:
                    feeds.previous()
            elif command == 113 or command == 27:
                self.browsing = False
                self.run = False