Пример #1
0
  def populate(self):
    if self.has_restarted:
      self.row_offset = self.current_idx
      self.has_restarted = False
    
    self.get_enigma_data()

    for address in self.data:
      building = Building(address)
      building.get_bis()
      if driver.title != DEFAULT_TITLE:
        print("Overworked server. Starting again.")
        while driver.title != DEFAULT_TITLE:
          timer = Timer(1.0, building.get_bis)
          timer.start()
      building.get_bis_data()
      if driver.title != PROPERTY_PROFILE_TITLE:  # listing not found -- move to next index
        print("Listing does not exist in BIS network")
        continue  # exit out of loop and proceed to next entry
      building.get_building_id()
      
      is_duplicate = building.check_if_duplicate()
      if is_duplicate:
        print("Duplicate entry: #{}".format(building.building_id))
        continue
      
      building.get_lat_long_coordinates()
      building.get_complaints_and_violations()      
      building.post_data()
      driver.quit()