1. Implement iter_<object> methods in proxybase.

2. Change include_object to include_media_object to avoid confusion
3. Make _validated_id_prefix method in read.py a staticmethod
4. Use new iter_<objects> methods in Records.py, StatsgGramplet.py, GivenNameGramplet.py, ExtractCity.py and _IsSiblingOfFilterMatch.py as examples

svn: r13151
This commit is contained in:
Gerald Britton
2009-09-02 20:10:45 +00:00
parent c22e47eba1
commit 3564b04584
10 changed files with 112 additions and 73 deletions

View File

@ -434,8 +434,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
self.name_list = []
for handle in db.iter_place_handles():
place = db.get_place_from_handle(handle)
for place in db.iter_places():
descr = place.get_title()
loc = place.get_main_location()
self.progress.step()
@ -455,7 +454,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
new_state = STATE_MAP.get(val.upper())
if new_state:
self.name_list.append(
(handle, (city, new_state[0], postal,
(place.handle, (city, new_state[0], postal,
COUNTRY[new_state[1]])))
continue
@ -471,7 +470,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
new_state = STATE_MAP.get(val.upper())
if new_state:
self.name_list.append(
(handle, (city, new_state[0], postal,
(place.handle, (city, new_state[0], postal,
COUNTRY[new_state[1]])))
continue
match = CITY_STATE.match(descr.strip())
@ -490,7 +489,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
new_state = STATE_MAP.get(val.upper())
if new_state:
self.name_list.append(
(handle, (city, new_state[0], postal,
(place.handle, (city, new_state[0], postal,
COUNTRY[new_state[1]])))
continue
@ -498,7 +497,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
new_state = STATE_MAP.get(val)
if new_state:
self.name_list.append(
(handle, (None, new_state[0], None,
(place.handle, (None, new_state[0], None,
COUNTRY[new_state[1]])))
self.progress.close()