Exemple #1
0
 def test_get_info(self):
     htmlcover = open(os.path.join(HTML_DIR, "cover.html")).read()
     info = pysheng.get_info(htmlcover)
     self.assertEqual('http://books.google.com/books?id=2TowtKyI27wC&lpg=PP1&ie=ISO-8859-1', info["prefix"])
     self.assertEqual(172, len(info["page_ids"]))
     self.assertEqual("Artistic Theory in Italy", info["title"])
     self.assertEqual("Anthony Blunt", info["attribution"])
Exemple #2
0
 def test_get_info(self):
     htmlcover = open(os.path.join(HTML_DIR, "cover.html")).read()
     info = pysheng.get_info(htmlcover)
     self.assertEqual('http://books.google.com/books?id=2TowtKyI27wC&'
                      'lpg=PP1&ie=ISO-8859-1', info["prefix"])
     self.assertEqual(172, len(info["page_ids"]))
     self.assertEqual("Artistic Theory in Italy", info["title"])
     self.assertEqual("Anthony Blunt", info["attribution"])
Exemple #3
0
def get_info(widgets, url, opener):
    debug = widgets.debug
    html = yield asyncjobs.ProgressDownloadThreadedTask(
        url, opener, headers=HEADERS, 
        elapsed_cb=functools.partial(on_elapsed, widgets, "info"))
    try:
        info = pysheng.get_info(html)
    except ValueError, detail:
        debug("Error parsing page HTML: %s" % str(detail))
        raise
Exemple #4
0
def get_info(widgets, url, opener):
    debug = widgets.debug
    html = yield asyncjobs.ProgressDownloadThreadedTask(
        url, opener, headers=HEADERS, 
        elapsed_cb=functools.partial(on_elapsed, widgets, "info"))
    try:
        info = pysheng.get_info(html)
    except ValueError, detail:
        debug("Error parsing page HTML: %s" % str(detail))
        raise