docs: def _change_state_prompt(mgr):
      """Runs a prompt to change the state of books.
  
      Registers `Event`s with `mgr` as they are requested.
  
      Args:
          mgr: A `KindleProgressMgr` object with the `books` and `progress`
              fields populated.
      """
      cmd = ''
      book_range = range(1, len(mgr.books) + 1)
      ind_to_book = dict(zip(book_range, mgr.books))
      get_book = lambda cmd_str: ind_to_book[int(cmd_str.split()[1])]
      while cmd != 'q':
          print 'Books:'
          for i in book_range:
              print '\t%d: %s' % (i, ind_to_book[i])
          print 'Commands:'
          print '| start {#}   | Start reading book with index {#}'
          print '| finish {#}  | Finish reading book with index {#}'
          print '| q           | Quit'
          cmd = safe_raw_input('> ')
          if cmd is None or cmd == 'q':
              break
          elif cmd.startswith('start '):
              book = get_book(cmd)
              initial_progress = mgr.progress[book.asin].locs[1]
              event = SetReadingEvent(book.asin, initial_progress)
          elif cmd.startswith('finish '):
              event = SetFinishedEvent(get_book(cmd).asin)
          else:
              print 'Invalid command'
              event = None
          if event is not None:
              print
              print 'REGISTERED EVENT:'
              print '  ' + str(event)
              mgr.register_events((event))
          print