# HG changeset patch # User Paul Boddie # Date 1509139768 -7200 # Node ID 110bbf25e2cc2151cda67bb1252b45306d1f9857 # Parent 9cabf3cd6a38c4e11028130ece06a96417a16ad5 Added a method to find the index of an attendee in the attendees list. diff -r 9cabf3cd6a38 -r 110bbf25e2cc imiptools/editing.py --- a/imiptools/editing.py Fri Oct 27 22:27:12 2017 +0200 +++ b/imiptools/editing.py Fri Oct 27 23:29:28 2017 +0200 @@ -535,6 +535,18 @@ return self.make_response_message(recipients, update_parent, all_rescheduled, to_reschedule) + # Access methods. + + def find_attendee(self, attendee): + + "Return the index of 'attendee' or None if not present." + + attendees = self.state.get("attendees") + try: + return attendees.keys().index(attendee) + except ValueError: + return None + # Modification methods. def add_attendee(self, uri=None):