Skip to content

Developer Guide: additions to the initial namespace of the Python Console#11090

Merged
feerrenrut merged 3 commits into
nvaccess:masterfrom
accessolutions:pr9064-devDocs
May 7, 2020
Merged

Developer Guide: additions to the initial namespace of the Python Console#11090
feerrenrut merged 3 commits into
nvaccess:masterfrom
accessolutions:pr9064-devDocs

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Follow-up of PR #9064
Follow-up of PR #9790

Summary of the issue:

These two PRs made additions to the initial namespace of the Python Console but missed to update the Developer Guide accordingly. (Yes, I'm one of the culprits...)

Description of how this pull request fixes the issue:

Add the new initial imports to the existing list.

Testing performed:

None

Known issues with pull request:

Change log entry:

I don't think these follow-ups deserve a change log entry.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to point to where to check this list, or temporarily add to it during development / debugging work. What do you think?

@feerrenrut feerrenrut changed the title Developer Guide: Follow-up of PR #9064 and PR #9790 Developer Guide: additions to the initial namespace of the Python Console May 4, 2020
@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

It might be useful to point to where to check this list, or temporarily add to it during development / debugging work. What do you think?

Might be. However, note that the current way it is implemented doesn't allow one to cleanly add new entries to the initial namespace from say a GlobalPlugin without first initializing the console altogether, which I'd prefer not to advise.
I could describe how to monkey-patch the console to reach that goal. It wasn't possible with the current implementation in Python 2, but the move to Python 3 opened new doors. This kind of trickery is probably out of scope for the Developer Guide...
I've thought I'd rather wait for the current backlog work to finish, then propose to move the namespace dict to a module attribute - where I believe it belongs - then document in the Developer Guide the new and clean way to add there...

Still, I can add now a note like "See pythonConsole.PythonConsole.initNamespace" and/or raise right away a three liner change proposal to allow for easier extensions to the initial namespace, as you prefer.

@feerrenrut

Copy link
Copy Markdown
Contributor

"See pythonConsole.PythonConsole.initNamespace "

That's what I had in mind, just a tip to see the working of it. Sometimes if restarting an in development version of NVDA lots of times and needing to run the same commands over and over in the console it's helpful to hack that file.

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

"See pythonConsole.PythonConsole.initNamespace "

That's what I had in mind, just a tip to see the working of it. Sometimes if restarting an in development version of NVDA lots of times and needing to run the same commands over and over in the console it's helpful to hack that file.

Done: d1a3617

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@feerrenrut feerrenrut merged commit 1b4252c into nvaccess:master May 7, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.1 milestone May 7, 2020
@feerrenrut feerrenrut modified the milestones: 2020.1, 2020.2 May 7, 2020
@JulienCochuyt JulienCochuyt deleted the pr9064-devDocs branch May 7, 2020 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants