VlibrasCheckVersion.py 772 Bytes
# -*- coding: utf-8 -*- 
from os import popen
import Util

PATH_RESOURCE = 'c:/vlibras-libs/update/'
TXT_LOCAL_VERSION = PATH_RESOURCE+'version/version.txt'


if __name__ == '__main__':

    listPlayerVersion = Util.getUrlDictPlayer()
    txt_local_version = open(TXT_LOCAL_VERSION, 'w')
    if len(listPlayerVersion) > 2:
        
        result = listPlayerVersion[0]
        if result.endswith('.exe'):
            txt_local_version.write('1')
        elif result.endswith('.zip'):
            txt_local_version.write('2')
            
    elif len(listPlayerVersion) == 0:
        txt_local_version.write('0')
    else:
        txt_local_version.write('-1')
        
    txt_local_version.close()
    
    print listPlayerVersion