#!/bin/bash

# Usage: 2to3 [options] file|dir ...
# 
# Options:
#   -h, --help            show this help message and exit
#   -d, --doctests_only   Fix up doctests only
#   -f FIX, --fix=FIX     Each FIX specifies a transformation; default: all
#   -x NOFIX, --nofix=NOFIX
#                         Prevent a fixer from being run.
#   -l, --list-fixes      List available transformations (fixes/fix_*.py)
#   -p, --print-function  Modify the grammar so that print() is a function
#   -v, --verbose         More verbose logging
#   -w, --write           Write back modified files
#   -n, --nobackups       Don't write backups for modified files.

TARGETS="_setup.py flickrapi flickrapi/xmlnode.py tests runtests"

echo "2to3 on Python code"
2to3 -wn \
    -f all \
    -f idioms \
    $TARGETS >/dev/null

echo
echo "2to3 on Doctests"
2to3 -dwn \
    -f all \
    -f idioms \
    $TARGETS >/dev/null

echo "Update final changes"
