Exemplo n.º 1
0
 def process(self, people_dict):
     people = people_dict.keys()
     people.sort()
     self.total = len(people)
     x = 0
     for name in people:
         x += 1
         info = people_dict[name]
         print "processing: %s/%s - %s" %(x, len(people), name)
         name = sanitize_name(name)
         if self.name_already_processed(name):
             self.skipped += 1
             continue           
         
         # URL
         base_dev = "http://dev.inghist.nl/retrotest2010/groen/"
         base_production = "http://www.inghist.nl/retroboeken/groen/"                          
         encoded_name = urllib.quote(urllib.quote(name.encode('utf8')))
         url = base_production + \
               "#accessor=accessor_index&accessor_href=accessor_index%3FSearchSource%253Autf-8%253Austring%3D" + \
               encoded_name
         
         bdes = BioDesDoc()
         args = dict(naam = name,
                     naam_publisher = "XXX",
                     url_publisher = "http://XXX.nl",
                     url_biografie = url,
                )
         """
         args = dict(naam = name,
                     figures =[(people_dict[id]['img_url'], 
                                people_dict[id]['caption'],
                               )],
                     naam_publisher = "Het Geheugen van Nederland",
                     url_biografie = people_dict[id]['bio_url'],
                     url_publisher = "http://geheugenvannederland.nl",
                     tekst = people_dict[id]['tekst']
                     )
         """
         birth_date = info['born']
         death_date = sterfdatum = info['dead']
         if bdes.is_date(birth_date):
             args['geboortedatum'] = birth_date
         if bdes.is_date(death_date):
             args['sterfdatum'] = death_date
             
         bdes.from_args(**args)
         self.write_file(bdes, x)