Skip to content

Support copying a fragment of the log to the clipboard (#9280)#9844

Merged
feerrenrut merged 18 commits into
nvaccess:masterfrom
accessolutions:i9280
Aug 10, 2020
Merged

Support copying a fragment of the log to the clipboard (#9280)#9844
feerrenrut merged 18 commits into
nvaccess:masterfrom
accessolutions:i9280

Conversation

@JulienCochuyt

@JulienCochuyt JulienCochuyt commented Jun 28, 2019

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #9280

Summary of the issue:

When debugging, it is often a pain to delimit the relevant fragment of the log.

Description of how this pull request fixes the issue:

Add a global command that marks the current end of the log as the start position.
When executed again, the same global command copies the log fragment to the clipboard.
I assigned the gesture NVDA+control+shift+F1 not to consume some easy one and because I usually set NVDA+F1 to open the log without adding dev info, and NVDA+shift+F1 for virtual review of dev info without adding to the log, but that's another topic.

Testing performed:

Tested running from source, with and without --no-logging and --secure parameters.

Known issues with pull request:

EDIT:
The first version was more rudimentary, as ported straight from a global plugin.
The new proposed implementation is split across GlobalCommand and logHandler, handles more possible causes of error, and respects secure mode by silently refusing to copy.

Change log entry:

Section: Changes for developpers
A fragment of the log can now be delimited and then copied to clipboard using NVDA+control+shift+F1

@JulienCochuyt JulienCochuyt force-pushed the i9280 branch 2 times, most recently from c85fbc5 to 9276dc1 Compare June 28, 2019 23:34
@XLTechie

XLTechie commented Jun 29, 2019 via email

Copy link
Copy Markdown
Collaborator

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

a keystroke to insert a mark line in the log, for easy searching

I also use this technique, it also comes in handy in some cases

I had held off posting it, because I thought some here would likely claim it was such a niche debugging specific option

I indeed actually dared posted this PR only because someone else raised #9280

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

a5f0805: Rebase onto latest master

@lukaszgo1

Copy link
Copy Markdown
Contributor

@JulienCochuyt Have you considered using script decorator here. I believe it should be used for the newly added scripts.

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

@JulienCochuyt Have you considered using script decorator here. I believe it should be used for the newly added scripts.

You are definitely right, thanks for pointing this out.
I also rebased onto latest master and reduced some lines length in conformance with the new linting integration.

@AppVeyorBot

Copy link
Copy Markdown

PR introduces Flake8 errors 😲

See test results for Failed build of commit c3430248e3

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

Rebased again onto latest master and removed bare excepts in favor of using a context manager.

@feerrenrut

Copy link
Copy Markdown
Contributor

I think this would be useful for developers. In the future we may want to hide some of these developer centered features unless in some kind of "developer mode"

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit d78cb2b9fb

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit efd6641e52

Comment thread source/globalCommands.py Outdated
@AppVeyorBot

Copy link
Copy Markdown

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

Caught by my own fix on checkPot... :)

Comment thread source/logHandler.py Outdated
Comment thread source/globalCommands.py Outdated

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set start and end point in a logfile via a hotkey and save this marked part on the Windows Desktop automatically

6 participants