This repository was archived by the owner on Mar 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Enable modification of NVDA settings in automation #14
Draft
jugglinmike
wants to merge
22
commits into
main
Choose a base branch
from
nvda-configuration-server
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Prior to this patch, the project's C++ code could only be built if Microsoft Visual Studio was run with the privileges of a system administrator. Encapsulate installation steps in the MakeVoice.exe binary, and extend that binary to require administrative privileges (allowing the code to be built without them). This change also supports forthcoming work to eliminate duplicated installation logic between the project's Node.js code and C++ code.
Maintain MakeVoice.exe's focus on managing the automation voice.
Store the Node.js code which defines the at-driver command-line interface in a dedicated directory to more clearly delineate it from the other "library" (i.e. interpreted) code that this project now includes.
mzgoddard
approved these changes
Apr 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@@ -0,0 +1 @@ | |||
7658 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the file just the port?
return Promise.race([whenClosed, invert(connect(4382, 'at=nvda&port=', SUB_PROTOCOL))]); | ||
}); | ||
|
||
test('server rejects empty assistive technology port', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'server rejects non-number assistive technology port'
* @param {object} body - the data to send | ||
*/ | ||
module.exports = function postJSON(port, body) { | ||
return new Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the nesting can be reduced some to be easier to read.
module.exports = async function postJSON(port, body) {
const response = await new Promise((resolve, reject) => {
const postData = JSON.stringify(body);
const request = http.request(
{
hostname: "localhost",
method: "POST",
port,
headers: {
"Content-Type": "application/json",
"Content-Length": Buffer.byteLength(postData),
},
},
resolve
);
request.on("error", reject);
request.write(postData);
request.end();
});
const responseBody = await new Promise((resolve) => {
let responseBody = "";
response.setEncoding("utf-8");
response.on("data", (chunk) => (responseBody += chunk));
response.on("end", () => {
resolve(responseBody);
});
});
if (!response.complete) {
throw new Error("HTTP response interrupted");
}
if (response.statusCode >= 300) {
throw new Error(responseBody);
}
};
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This work builds on gh-13 (which itself builds on gh-11), and as such, potential reviewers may want to hold off on offering feedback. The change set in gh-13 may evolve prior to being merged, and that may necessitate further modification to this patch. I'm submitting it as a "Draft Pull Request" to give some more visibility to the work, even before it's ready for formal review.