def getUpToVersion():
    grab_next = False
    for arg in sys.argv:
        if arg.strip() == "--to":
            grab_next = True
        elif arg.startswith("--to=") or grab_next == True:
            try:
                to_version = int(arg.replace("--to=",""))
                print "~ Migrating to version: %(tv)s" % {'tv': to_version}
                return to_version
            except __HOLE__:
                print "~   ERROR: unable to parse --to argument: '%(ta)s'" % { 'ta': arg }
                return None

    return None

# ~~~~~~~~~~~~~~~~~~~~~~ getVersion(dbname) is to look up the version number of the database
dataset/ETHPy150Open eBay/restcommander/play-1.2.4/modules/migrate-1.4/commands.py/getUpToVersion