Changeset 1088

Show
Ignore:
Timestamp:
08/27/07 17:41:31 (1 year ago)
Author:
sgillies
Message:

Fix problems with loading villas

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesEntity/trunk/Extensions/loader.py

    r1084 r1088  
    368368    else: 
    369369        placeType = 'unknown' 
    370     legaltypes = ['aqueduct', 'bath', 'bay', 'bridge', 'canal', 'cape', 'cave', 'cemetery', 'centuriation', 'church', 'coast', 'dam', 'estate', 'estuary', 'false', 'findspot', 'forest', 'fort', 'hill', 'island', 'lighthouse', 'mine', 'mountain', 'oasis', 'pass', 'people', 'plain', 'port', 'production', 'region', 'reservoir', 'ridge', 'river', 'road', 'salt-marsh', 'settlement', 'settlement-modern', 'spring', 'station', 'temple', 'tumulus', 'undefined', 'unknown', 'unlocated', 'valley', 'wall', 'water-inland', 'water-open', 'well', 'wheel', 'whirlpool'] 
     370    legaltypes = ['aqueduct', 'bath', 'bay', 'bridge', 'canal', 'cape', 'cave', 'cemetery', 'centuriation', 'church', 'coast', 'dam', 'estate', 'estuary', 'false', 'findspot', 'forest', 'fort', 'hill', 'island', 'lighthouse', 'mine', 'mountain', 'oasis', 'pass', 'people', 'plain', 'port', 'production', 'region', 'reservoir', 'ridge', 'river', 'road', 'salt-marsh', 'settlement', 'settlement-modern', 'spring', 'station', 'temple', 'tumulus', 'undefined', 'unknown', 'unlocated', 'valley', 'villa', 'wall', 'water-inland', 'water-open', 'well', 'wheel', 'whirlpool'] 
    371371    try: 
    372372        ptidx = legaltypes.index(placeType) 
     
    390390    placeNames = [getattr(names, nid) for nid in nids] 
    391391    computedTitle = '/'.join([n.Title() for n in placeNames]) 
    392     pid = places.invokeFactory('Place', 
     392     
     393    # Catch attribute errors from the case of pre-existing content and 
     394    # move on. This lets us run loads again over previously loaded data. 
     395    try: 
     396        pid = places.invokeFactory('Place', 
    393397                    id=id, 
    394398                    title=computedTitle, 
     
    399403                    description=description 
    400404                    ) 
    401     p = getattr(places, pid) 
    402     p.reindexObject() 
     405        p = getattr(places, pid) 
     406        p.reindexObject() 
     407    except AttributeError: 
     408        return {'place_id': None, 'location_ids': None, 'name_ids': None} 
    403409 
    404410    # Iterate over locations