VlibrasCheckVersion.py
772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# -*- 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