Skip to content

Commit 88fa91f

Browse files
committed
Add script for reporting current second
1 parent 95ec284 commit 88fa91f

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

addon/globalPlugins/devBox/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
from pathlib import Path
23

34
import addonHandler
@@ -122,3 +123,10 @@ def script_report_current_line_length(self, gesture):
122123
text_info.expand(textInfos.UNIT_LINE)
123124
line = text_info.text.rstrip("\r\n")
124125
ui.message(str(len(line)))
126+
127+
@scriptHandler.script(
128+
description=_("Report current second in a minute"),
129+
gesture="kb:nvda+control+f12",
130+
)
131+
def script_report_current_second(self, gesture):
132+
ui.message(str(datetime.datetime.now().second))

readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ You can see that there are 12 spaces in the middle, and nvda will skip them when
1515
Pressing nvda+up or nvda+numpad8 twice will read all the spaces one by one, which is usually not very convenient.
1616

1717
This addon detects 2 or more consecutive spaces, and folds them into a short sequence.
18+
1819
For example "space space space space space" becomes "5 space".
1920

2021
### Diff indication
@@ -28,5 +29,26 @@ The sounds are taken from vscode, they are also slightly modified (a small amoun
2829
This feature allows to find out the length of the line under cursor, it can be useful when formatting code or any other text.
2930
Gesture is unassigned by default.
3031

32+
### Get second in the current minute
33+
Can be useful for an approximate measurement of time intervals from a few seconds to a couple of minutes.
34+
35+
For example, you can debug a non-optimized program, the execution of a part of which takes a long time.
36+
37+
Suppose you launched the process and checked the second, you received the number 5.
38+
39+
When the process ended, you again requested the value of a second: 30.
40+
41+
Thus, the program hung for about 25 seconds, you can improve the code and take similar measurements again.
42+
43+
Also could be used for more accurate setting of the clock, which resets seconds to zero when applying settings.
44+
45+
Of course, you can simply enable the display of seconds in Windows settings, but in some cases it is convenient to immediately get the most actual value without listening information about the hour and minute.
46+
47+
nvda+ctrl+f12 is bound by default.
48+
3149
---
3250
All passive features, like space folding, is disabled by default, they could be enabled in addon settings.
51+
52+
## Change log
53+
### 0.2.0
54+
Script for reporting current second was added.

0 commit comments

Comments
 (0)