def deltas(deltacode, all_delta_types=False):
    """
    Return a generator of Delta dictionaries for JSON serialized ouput.  Omit
    all unmodified Delta objects unless the user selects the '-a'/'--all'
    option.
    """
    for delta in deltacode.deltas:
        if all_delta_types is True:
            yield delta.to_dict()
        elif not delta.is_unmodified():
            yield delta.to_dict()
