+def delete_local (person,default_bool,options):
+
+ # just in case
+ if person['peer_id'] != None:
+ print 'ERROR: cannot delete non-local person',person['email']
+ return
+
+ prompt = 'want to delete '+person['email']
+ if default_bool: prompt += ' v(erbose)/[y]/n ? '
+ else: prompt += ' v(erbose)y/[n] ? '
+
+ done=False
+
+ while not done:
+ done=True
+ try:
+ answer = raw_input(prompt).strip()
+ except EOFError :
+ print 'bailing out'
+ sys.exit(1)
+
+ if answer=='':
+ do_delete=default_bool
+ elif answer.lower()[0]=='y':
+ do_delete=True
+ elif answer.lower()[0]=='n':
+ do_delete=False
+ elif answer.lower()[0]=='v':
+ details_person(person)
+ done=False
+ else:
+ done=False
+ id=person['person_id']
+ email=person['email']
+ if options.dry_run:
+ if do_delete: print 'Would delete',id,'->',email
+ else: print 'Would preserve',id,'->',email
+ elif do_delete:
+ print 'Deleting',id,'->',email,
+ if DeletePerson(id) == 1: print 'OK',id,'deleted'
+ else: print 'Deletion failed'
+
+def main_orphans (options):