コード例 #1
0
 def getFromPSSOIterator(self, username, password):
     """Get grades from PSSO and feed them to the table model.
     This function returns a generator that yields 8 strings describing
     the progress.
     """
     if not username or not password:
         raise ValueError("Please provide valid username and password")
     
     iterator = web_scraper.getHTMLFromPSSOIterator(username, password)
     for i in range(6): # see docs of getHTMLFromPSSOIterator() why 6
         yield iterator.next()
     html = iterator.next() # should be the html doc
     yield "Parsing grades"
     subjects = web_scraper.getSubjectsFromHTML(html)
     self.beginResetModel()
     self.subjects = subjects
     self.endResetModel()
     yield "Done"
コード例 #2
0
 def getFromHTML(self, html):
     subjects = web_scraper.getSubjectsFromHTML(html)
     self.beginResetModel()
     self.subjects = subjects
     self.endResetModel()