~markjtully/onehundredscopes/medicines-lens

« back to all changes in this revision

Viewing changes to unity-medicines-daemon

  • Committer: Mark Tully
  • Date: 2013-01-09 23:39:33 UTC
  • Revision ID: markjtully@gmail.com-20130109233933-ubguffjygnd5f1ua
Further attempts to narrow down a bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
273
273
                try:
274
274
                    # Get details fro the infobox on the wiki page for the preview description
275
275
                    link = tree.xpath("//table[@class='infobox']")[0]
 
276
                    
 
277
                    print(wikipage)
 
278
                    tree1 = lxml.html.parse(wikipage)
 
279
                    print(lxml.html.tostring(tree1.xpath("//body")[0])[:5000])
 
280
                    
276
281
                    infobox = link.text_content()
277
282
                    infobox = infobox.replace("\n", "\t")
278
283
 
366
371
                        except:
367
372
                            myopener.retrieve(image, '/tmp/unity-lens-medicines/%s.png' % word.title())
368
373
                            print("No image transformation performed")
369
 
                except:
 
374
                except IndexError as e:
370
375
                    print(wikipage)
371
376
                    tree = lxml.html.parse(wikipage)
372
377
                    print(lxml.html.tostring(tree.xpath("//body")[0])[:5000])
 
378
                    print(e)
373
379
                
374
380
                # Assemble the preview
375
381
                self.preview = Unity.GenericPreview.new(title, description, None)