17
17
:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
18
18
:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
20
20
:: This is very annoying; FOR /F will work differently depending on the output
21
21
:: of reg which is not consistent between OS versions (XP, 7). We must choose
22
22
:: the tokens according to OS version.
25
25
IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=4
26
26
ECHO Checking if python 2.7 is in the system
27
27
:: Look for python 2.7
28
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A
29
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
28
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
29
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
30
30
ECHO Checking if python 2.6 is in the system
31
31
:: we do not have python 2.7 in the system, try to find 2.6
32
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A
33
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
32
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
33
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
35
35
:: we do not have python (2.6 or 2.7) this could hapen in the case that the
36
36
:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
38
38
:: Look for python 2.7 in WoW64
39
39
ECHO Checking if python 2.7 32 is in the system
40
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONPATH=%%A
41
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
40
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
41
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
42
42
ECHO Checking if python 2.6 32 is in the system
43
43
:: we do not have python 2.7 in the system, try to find 2.6
44
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONPATH=%%A
45
IF NOT %PYTHONPATH% == "" GOTO :PYTHONPRESENT
44
FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A
45
IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT
47
47
ECHO Please ensure you have python installed
52
52
ECHO Python found, building auto-generated modules...
53
53
:: call setup.py build so that the qt uic is called
54
::START "Build code" /D%CD% /WAIT "%PYTHONPATH%\python.exe" setup.py build
55
"%PYTHONPATH%\python.exe" setup.py build
54
::START "Build code" /D%CD% /WAIT "%PYTHONEXEPATH%\python.exe" setup.py build
55
"%PYTHONEXEPATH%\python.exe" setup.py build
57
57
:: execute the tests with a number of ignored linux only modules
58
"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1trial" -r txnamedpipes -c ubuntu_sso -i "test_gui.py, test_linux.py, test_txsecrets.py"
58
"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" -c ubuntu_sso -i "test_gui.py, test_linux.py, test_txsecrets.py" --reactor=txnp
59
59
:: Clean the build from the setupt.py
60
60
ECHO Cleaning the generated code before running the style checks...
61
"%PYTHONPATH%\python.exe" setup.py clean
61
"%PYTHONEXEPATH%\python.exe" setup.py clean
62
62
ECHO Performing style checks...
63
"%PYTHONPATH%\python.exe" "%PYTHONPATH%\Scripts\u1lint" ubuntu_sso
63
"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" ubuntu_sso
64
64
:: test for style if we can, if pep8 is not present, move to the end
65
IF EXIST "%PYTHONPATH%\Scripts\pep8.exe"
66
"%PYTHONPATH%\Scripts\pep8.exe" --repeat ubuntu_sso
65
IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe"
66
"%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat ubuntu_sso
68
68
ECHO Style checks were not done
69
69
:: Delete the temp folders
70
70
RMDIR /s /q _trial_temp
71
71
RMDIR /s /q .coverage
b'\\ No newline at end of file'