#!/usr/bin/env python
# -*- coding: cp936 -*-

import RES.ver1To2
import RES.ver2To3
import RES.ver3To4
import RES.ver4To5
import RES.ver5To6
import RES.ver6To7
import RES.ver7To8
import RES.ver8To9
import RES.ver9To10
import BaseProc
import logging
import logger

logp = logger.FinalLogger.getLogger()

v1To2 = RES.ver1To2.ver1To2()
v2To3 = RES.ver2To3.ver2To3()
v3To4 = RES.ver3To4.ver3To4()
v4To5 = RES.ver4To5.ver4To5()
v5To6 = RES.ver5To6.ver5To6()
v6To7 = RES.ver6To7.ver6To7()
v7To8 = RES.ver7To8.ver7To8()
v8To9 = RES.ver8To9.ver8To9()
v9To10 = RES.ver9To10.ver9To10()


support = [v1To2, v2To3, v3To4, v4To5, v5To6, v6To7, v7To8, v8To9, v9To10]


def verRESData(inOld, inNew, inFn):
    logp.info ('RES %d to %d', inOld , inNew)
    for member in support:
        old, new = member.GetOldNew()
        if ((old == inOld) and (new == inNew)):
            return member.process(inFn)
    logp.error ('not support %d to %d', inOld, inNew)
    return 1
