forked from nvaccess/nvda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logging: No longer mark log messages from nvda.pyw as coming from ext…
…ernal code when running from sources (nvaccess#13827) Summary of the issue: When starting NVDA from sources messages logged from nvda.pyw are shown as external. Example message: INFO - external:__main__ (17:20:02.477) - MainThread (4316): Starting NVDA version source-master-b817b03 This is clearly wrong. The problem is caused by the trailing backslash added in bat scripts (%~dp0 is already terminated with one and adding a second backslash causes logHandler.isPathExternalToNVDA to think that the path is external). Description of user facing changes Log messages from nvda.pyw are no longer marked as external. Description of development approach All usages of %~dp0 are inspected and trailing backslash is no longer added to the paths. To make logHandler.isPathExternalToNVDA more resilient to invalid paths the path is normalized before checking if it is the same as sys.path.
- Loading branch information
Showing
10 changed files
with
66 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
@echo off | ||
rem runlint <base commit> [<output file>] | ||
rem Lints any changes after base commit up to and including current HEAD, plus any uncommitted changes. | ||
call "%~dp0\venvUtils\venvCmd.bat" py "%~dp0\tests\lint\genDiff.py" %1 "%~dp0\tests\lint\_lint.diff" | ||
set hereOrig=%~dp0 | ||
set here=%hereOrig% | ||
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% | ||
set scriptsDir=%here%\venvUtils | ||
set lintFilesPath=%here%\tests\lint | ||
|
||
call "%scriptsDir%\venvCmd.bat" py "%lintFilesPath%\genDiff.py" %1 "%lintFilesPath%\_lint.diff" | ||
if ERRORLEVEL 1 exit /b %ERRORLEVEL% | ||
set flake8Args=--diff --config="%~dp0\tests\lint\flake8.ini" | ||
set flake8Args=--diff --config="%lintFilesPath%\flake8.ini" | ||
if "%2" NEQ "" set flake8Args=%flake8Args% --tee --output-file=%2 | ||
type "%~dp0\tests\lint\_lint.diff" | call "%~dp0\venvUtils\venvCmd.bat" py -Xutf8 -m flake8 %flake8Args% | ||
type "%lintFilesPath%\_lint.diff" | call "%scriptsDir%\venvCmd.bat" py -Xutf8 -m flake8 %flake8Args% | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
@echo off | ||
call "%~dp0\venvUtils\venvCmd.bat" start pyw "%~dp0\source\nvda.pyw" %* | ||
set hereOrig=%~dp0 | ||
set here=%hereOrig% | ||
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% | ||
set scriptsDir=%here%\venvUtils | ||
set sourceDirPath=%here%\source | ||
|
||
call "%scriptsDir%\venvCmd.bat" start pyw "%sourceDirPath%\nvda.pyw" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
@echo off | ||
call "%~dp0\venvUtils\venvCmd.bat" py -m robot --argumentfile "%~dp0\tests\system\guiDiff.robot" %* "%~dp0\tests\system\robot" | ||
set hereOrig=%~dp0 | ||
set here=%hereOrig% | ||
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% | ||
set scriptsDir=%here%\venvUtils | ||
set systemTestsPath=%here%\tests\system | ||
|
||
call "%scriptsDir%\venvCmd.bat" py -m robot --argumentfile "%systemTestsPath%\guiDiff.robot" %* "%systemTestsPath%\robot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
@echo off | ||
call "%~dp0\venvUtils\venvCmd.bat" py -m robot --argumentfile "%~dp0\tests\system\robotArgs.robot" %* "%~dp0\tests\system\robot" | ||
set hereOrig=%~dp0 | ||
set here=%hereOrig% | ||
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% | ||
set scriptsDir=%here%\venvUtils | ||
set systemTestsPath=%here%\tests\system | ||
|
||
call "%scriptsDir%\venvCmd.bat" py -m robot --argumentfile "%systemTestsPath%\robotArgs.robot" %* "%systemTestsPath%\robot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
@echo off | ||
call "%~dp0\venvUtils\venvCmd.bat" py -m nose -sv --traverse-namespace -w "%~dp0\tests\unit" %* | ||
set hereOrig=%~dp0 | ||
set here=%hereOrig% | ||
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% | ||
set scriptsDir=%here%\venvUtils | ||
set unitTestsPath=%here%\tests\unit | ||
|
||
call "%scriptsDir%\venvCmd.bat" py -m nose -sv --traverse-namespace -w "%unitTestsPath%" %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@echo off | ||
rem Executes SScons within the NVDA build system's Python virtual environment. | ||
call "%~dp0\venvUtils\venvCmd.bat" py -m SCons %* | ||
set hereOrig=%~dp0 | ||
set here=%hereOrig% | ||
if #%hereOrig:~-1%# == #\# set here=%hereOrig:~0,-1% | ||
set scriptsDir=%here%\venvUtils | ||
call "%scriptsDir%\venvCmd.bat" py -m SCons %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters