Ticket #45: docstrings.patch
| File docstrings.patch, 15.6 KB (added by doug, 4 years ago) |
|---|
-
source/appModules/_default.py
61 61 speech.speakFormattedText(info) 62 62 else: 63 63 speech.speakSpelling(info._get_text()) 64 script_reportCurrentLine.__doc__=_("Reports the current line under the application cursor. Pressing this key twice will spell the current line") 64 65 65 66 def script_reportCurrentSelection(self,keyPress,nextScript): 66 67 obj=api.getFocusObject() … … 72 73 speech.speakMessage(_("no selection")) 73 74 else: 74 75 speech.speakMessage(_("selected %s")%info.text) 75 76 script_reportCurrentSelection.__doc__=_("Reports what is selected in the current application") 76 77 def script_dateTime(self,keyPress,nextScript): 77 78 if keyboardHandler.lastKeyCount == 1: 78 79 text=winKernel.GetTimeFormat(winKernel.getThreadLocale(), winKernel.TIME_NOSECONDS, None, None) 79 80 else: 80 81 text=winKernel.GetDateFormat(winKernel.getThreadLocale(), winKernel.DATE_LONGDATE, None, None) 81 82 speech.speakMessage(text) 82 script_dateTime.__doc__=_(" Reports the current date and time")83 script_dateTime.__doc__=_("The first time this key is pressed reports the system time. The second time this key is pressed the system date is reported") 83 84 84 85 def script_increaseRate(self,keyPress,nextScript): 85 86 rate=min(getSynth().rate+5, 100) … … 98 99 def script_increaseSetting(self,keyPress,nextScript): 99 100 #val = globalVars.settingsRing.increase() 100 101 speech.speakMessage("%s %s" % (globalVars.settingsRing.currentSettingName, globalVars.settingsRing.increase())) 101 script_increaseSetting.__doc__=_("Increases currently active setting in the synth settings ring")102 script_increaseSetting.__doc__=_("Increases the currently active setting in the synth settings ring") 102 103 103 104 def script_decreaseSetting(self,keyPress,nextScript): 104 105 #val = globalVars.settingsRing.decrease() 105 106 speech.speakMessage("%s %s" % (globalVars.settingsRing.currentSettingName, globalVars.settingsRing.decrease())) 106 script_decreaseSetting.__doc__=_("Decreases currently active setting in the synth settings ring")107 script_decreaseSetting.__doc__=_("Decreases the currently active setting in the synth settings ring") 107 108 108 109 def script_nextSetting(self,keyPress,nextScript): 109 110 #name = globalVars.settingsRing.next() … … 171 172 obj=api.getMouseObject() 172 173 api.setNavigatorObject(obj) 173 174 speech.speakObject(obj) 175 script_moveNavigatorObjectToMouse.__doc__=_("Moves the navigator object to the mouse object and speaks what is under the mouse") 174 176 175 176 177 def script_navigatorObject_current(self,keyPress,nextScript): 177 178 curObject=api.getNavigatorObject() 178 179 if not isinstance(curObject,NVDAObject): … … 349 350 info.expand(textHandler.UNIT_LINE) 350 351 speech.speakMessage(_("top")) 351 352 speech.speakFormattedText(info) 352 script_review_top.__doc__=_("Moves the review cursor to the top line of the current navigator object ")353 script_review_top.__doc__=_("Moves the review cursor to the top line of the current navigator object and speaks it") 353 354 354 355 def script_review_previousLine(self,keyPress,nextScript): 355 356 info=globalVars.reviewPosition.copy() … … 361 362 if res==0: 362 363 speech.speakMessage(_("top")) 363 364 speech.speakFormattedText(info) 364 script_review_previousLine.__doc__=_("Moves the review cursor to the previous line of the current navigator object ")365 script_review_previousLine.__doc__=_("Moves the review cursor to the previous line of the current navigator object and speaks it") 365 366 366 367 def script_review_currentLine(self,keyPress,nextScript): 367 368 from keyboardHandler import lastKeyCount … … 371 372 speech.speakFormattedText(info) 372 373 else: 373 374 speech.speakSpelling(info._get_text()) 374 script_review_currentLine.__doc__=_("Reports the line of the current navigator object where the review cursor is situated ")375 script_review_currentLine.__doc__=_("Reports the line of the current navigator object where the review cursor is situated. If this key is pressed twice the current line will be spelled") 375 376 376 377 def script_review_nextLine(self,keyPress,nextScript): 377 378 info=globalVars.reviewPosition.copy() … … 383 384 if res==0: 384 385 speech.speakMessage(_("bottom")) 385 386 speech.speakFormattedText(info) 386 script_review_nextLine.__doc__=_("Moves the review cursor to the next line of the current navigator object ")387 script_review_nextLine.__doc__=_("Moves the review cursor to the next line of the current navigator object and speaks it") 387 388 388 389 def script_review_bottom(self,keyPress,nextScript): 389 390 info=globalVars.reviewPosition.obj.makeTextInfo(textHandler.POSITION_LAST) … … 391 392 info.expand(textHandler.UNIT_LINE) 392 393 speech.speakMessage(_("bottom")) 393 394 speech.speakFormattedText(info) 394 script_review_bottom.__doc__=_("Moves the review cursor to the bottom line of the current navigator object ")395 script_review_bottom.__doc__=_("Moves the review cursor to the bottom line of the current navigator object and speaks it") 395 396 396 397 def script_review_previousWord(self,keyPress,nextScript): 397 398 info=globalVars.reviewPosition.copy() … … 403 404 if res==0: 404 405 speech.speakMessage(_("top")) 405 406 speech.speakFormattedText(info) 406 script_review_previousWord.__doc__=_("Moves the review cursor to the previous word of the current navigator object ")407 script_review_previousWord.__doc__=_("Moves the review cursor to the previous word of the current navigator object and speaks it") 407 408 408 409 def script_review_currentWord(self,keyPress,nextScript): 409 410 from keyboardHandler import lastKeyCount … … 413 414 speech.speakFormattedText(info) 414 415 else: 415 416 speech.speakSpelling(info._get_text()) 416 script_review_currentWord.__doc__=_("Speaks the word of the current navigator object where the review cursor is situated ")417 script_review_currentWord.__doc__=_("Speaks the word of the current navigator object where the review cursor is situated. If this key is pressed twice the word will be spelled") 417 418 418 419 def script_review_nextWord(self,keyPress,nextScript): 419 420 info=globalVars.reviewPosition.copy() … … 425 426 if res==0: 426 427 speech.speakMessage(_("bottom")) 427 428 speech.speakFormattedText(info) 428 script_review_nextWord.__doc__=_("Moves the review cursor to the next word of the current navigator object ")429 script_review_nextWord.__doc__=_("Moves the review cursor to the next word of the current navigator object and speaks it") 429 430 430 431 def script_review_startOfLine(self,keyPress,nextScript): 431 432 info=globalVars.reviewPosition.copy() … … 435 436 info.expand(textHandler.UNIT_CHARACTER) 436 437 speech.speakMessage(_("left")) 437 438 speech.speakFormattedText(info,handleSymbols=True) 438 script_review_startOfLine.__doc__=_("Moves the review cursor to the start of the line where it is sit uated, in the current navigator object")439 script_review_startOfLine.__doc__=_("Moves the review cursor to the start of the line where it is sit&uated, in the current navigator object") 439 440 440 441 def script_review_previousCharacter(self,keyPress,nextScript): 441 442 lineInfo=globalVars.reviewPosition.copy() … … 453 454 globalVars.reviewPosition=charInfo.copy() 454 455 charInfo.expand(textHandler.UNIT_CHARACTER) 455 456 speech.speakFormattedText(charInfo,handleSymbols=True) 456 script_review_previousCharacter.__doc__=_("Moves the review cursor to the previous character of the current navigator object ")457 script_review_previousCharacter.__doc__=_("Moves the review cursor to the previous character of the current navigator object and speaks it") 457 458 458 459 def script_review_currentCharacter(self,keyPress,nextScript): 459 460 info=globalVars.reviewPosition.copy() … … 468 469 speech.speakSpelling(hex(c)) 469 470 except: 470 471 speech.speakFormattedText(info,handleSymbols=True) 471 script_review_currentCharacter.__doc__=_("Reports the character of the current navigator object where the review cursor is situated ")472 script_review_currentCharacter.__doc__=_("Reports the character of the current navigator object where the review cursor is situated. If this key is pressed twice ascii and hexadecimal values are spoken for the character") 472 473 473 474 def script_review_nextCharacter(self,keyPress,nextScript): 474 475 lineInfo=globalVars.reviewPosition.copy() … … 486 487 globalVars.reviewPosition=charInfo.copy() 487 488 charInfo.expand(textHandler.UNIT_CHARACTER) 488 489 speech.speakFormattedText(charInfo,handleSymbols=True) 489 script_review_nextCharacter.__doc__=_("Moves the review cursor to the next character of the current navigator object ")490 script_review_nextCharacter.__doc__=_("Moves the review cursor to the next character of the current navigator object and speaks it") 490 491 491 492 def script_review_endOfLine(self,keyPress,nextScript): 492 493 info=globalVars.reviewPosition.copy() … … 538 539 539 540 def script_showGui(self,keyPress,nextScript): 540 541 gui.showGui() 541 script_showGui.__doc__=_("Shows the NVDA interface window")542 script_showGui.__doc__=_("Shows the NVDA interface menu") 542 543 543 544 def script_review_sayAll(self,keyPress,nextScript): 544 545 info=globalVars.reviewPosition.copy() 545 546 sayAllHandler.readText(info,sayAllHandler.CURSOR_REVIEW) 546 script_review_sayAll.__doc__ = _("reads from review cursor up to end ofcurrent text, moving the review cursor as it goes")547 script_review_sayAll.__doc__ = _("reads from the review cursor up to the end of the current text, moving the review cursor as it goes") 547 548 548 549 def script_navigatorObject_sayAll(self,keyPress,nextScript): 549 550 obj=api.getNavigatorObject() 550 551 sayAllHandler.readObjects(obj) 551 script_navigatorObject_sayAll.__doc__ = _("reads from navigator object ")552 script_navigatorObject_sayAll.__doc__ = _("reads from the navigator object ") 552 553 553 554 def script_sayAll(self,keyPress,nextScript): 554 555 o=api.getFocusObject() … … 560 561 o=v 561 562 info=o.makeTextInfo(textHandler.POSITION_CARET) 562 563 sayAllHandler.readText(info,sayAllHandler.CURSOR_CARET) 563 script_sayAll.__doc__ = _("reads from system caret up to end oftext, moving the caret as it goes")564 script_sayAll.__doc__ = _("reads from the system caret up to the end of the text, moving the caret as it goes") 564 565 565 566 def script_reportFormatting(self,keyPress,nextScript): 566 567 o=api.getFocusObject() … … 572 573 if item.cmd in (textHandler.FORMAT_CMD_SWITCHON,textHandler.FORMAT_CMD_CHANGE): 573 574 speech.speakMessage("%s %s"%(controlTypes.speechRoleLabels[item.format.role],item.format.value)) 574 575 576 script_reportFormatting.__doc__=_("If the cursor is on a character, speaks the format information under the cursor. This includes font information such as name, style, size, bold, or underlined") 575 577 576 577 578 def script_reportCurrentFocus(self,keyPress,nextScript): 578 579 focusObject=api.getFocusObject() 579 580 if isinstance(focusObject,NVDAObject): … … 596 597 else: 597 598 speech.speakSpelling(statusBarObject.value) 598 599 api.setNavigatorObject(statusBarObject) 599 script_reportStatusLine.__doc__ = _("reads the current ap lication status bar and moves the navigation cursor to it")600 script_reportStatusLine.__doc__ = _("reads the current application status bar and moves the navigation cursor to it") 600 601 601 602 def script_toggleReportObjectUnderMouse(self,keyPress,nextScript): 602 603 if config.conf["mouse"]["reportObjectUnderMouse"]: … … 638 639 speech.speakMessage(_("internal text: %s")%winUser.getWindowText(obj.windowHandle)) 639 640 speech.speakMessage(_("text: %s")%obj.windowText) 640 641 speech.speakMessage("is unicode: %s"%ctypes.windll.user32.IsWindowUnicode(obj.windowHandle)) 641 script_test_navigatorWindowInfo.__doc__ = _("reports some info about the current navigator object, mainly useful for developers. When pressed 2 times it copies control id, class and internal text to the windows clipboard")642 script_test_navigatorWindowInfo.__doc__ = _("reports some information about the current navigator object, mainly useful for developers. When pressed 2 times it copies control id, class and internal text to the windows clipboard") 642 643 643 644 def script_toggleBeepOnProgressBarUpdates(self,keyPress,nextScript): 644 645 if config.conf["presentation"]["beepOnProgressBarUpdates"]: … … 648 649 onOff=_("on") 649 650 config.conf["presentation"]["beepOnProgressBarUpdates"]=True 650 651 speech.speakMessage(_("Beep on progress bar updates")+" "+onOff) 651 script_toggleBeepOnProgressBarUpdates.__doc__=_("Toggles on and off the beeping o nprogress bar updates")652 script_toggleBeepOnProgressBarUpdates.__doc__=_("Toggles on and off the beeping of progress bar updates") 652 653 653 654 def script_toggleReportDynamicContentChanges(self,keyPress,nextScript): 654 655 if globalVars.reportDynamicContentChanges: … … 717 718 718 719 def script_activateGeneralSettingsDialog(self,keyPress,nextScript): 719 720 mainFrame.onGeneralSettingsCommand(None) 720 script_activateGeneralSettingsDialog.__doc__ = _("Shows NVDA general settings dialog")721 script_activateGeneralSettingsDialog.__doc__ = _("Shows the NVDA general settings dialog") 721 722 722 723 def script_activateSynthesizerDialog(self,keyPress,nextScript): 723 724 mainFrame.onSynthesizerCommand(None) 724 script_activateSynthesizerDialog.__doc__ = _("Shows NVDA synthesizer dialog")725 script_activateSynthesizerDialog.__doc__ = _("Shows the NVDA synthesizer dialog") 725 726 726 727 def script_activateVoiceDialog(self,keyPress,nextScript): 727 728 mainFrame.onVoiceCommand(None) 728 script_activateVoiceDialog.__doc__ = _("Shows NVDA voice settings dialog")729 script_activateVoiceDialog.__doc__ = _("Shows the NVDA voice settings dialog") 729 730 730 731 def script_activateKeyboardSettingsDialog(self,keyPress,nextScript): 731 732 mainFrame.onKeyboardSettingsCommand(None) 732 script_activateKeyboardSettingsDialog.__doc__ = _("Shows NVDA keyboard settings dialog")733 script_activateKeyboardSettingsDialog.__doc__ = _("Shows the NVDA keyboard settings dialog") 733 734 734 735 def script_activateMouseSettingsDialog(self,keyPress,nextScript): 735 736 mainFrame.onMouseSettingsCommand(None) 736 script_activateMouseSettingsDialog.__doc__ = _("Shows NVDA mouse settings dialog")737 script_activateMouseSettingsDialog.__doc__ = _("Shows the NVDA mouse settings dialog") 737 738 738 739 def script_activateObjectPresentationDialog(self,keyPress,nextScript): 739 740 mainFrame. onObjectPresentationCommand(None) 740 script_activateObjectPresentationDialog.__doc__ = _("Shows NVDA object presentation settings dialog")741 script_activateObjectPresentationDialog.__doc__ = _("Shows the NVDA object presentation settings dialog") 741 742 742 743 def script_activateVirtualBuffersDialog(self,keyPress,nextScript): 743 744 mainFrame.onVirtualBuffersCommand(None) 744 script_activateVirtualBuffersDialog.__doc__ = _("Shows NVDA virtual buffers settings dialog")745 script_activateVirtualBuffersDialog.__doc__ = _("Shows the NVDA virtual buffers settings dialog") 745 746 746 747 def script_activateDocumentFormattingDialog(self,keyPress,nextScript): 747 748 mainFrame.onDocumentFormattingCommand(None) 748 script_activateDocumentFormattingDialog.__doc__ = _("Shows NVDA document formatting settings dialog")749 script_activateDocumentFormattingDialog.__doc__ = _("Shows the NVDA document formatting settings dialog") 749 750 750 751 751 def script_saveConfiguration(self,keyPress,nextScript): 752 752 mainFrame.onSaveConfigurationCommand(None) 753 script_saveConfiguration.__doc__ = _("Saves current NVDA configuration to file")753 script_saveConfiguration.__doc__ = _("Saves the current NVDA configuration to nvda.ini") 754 754 755 755 def script_revertToSavedConfiguration(self,keyPress,nextScript): 756 756 mainFrame.onRevertToSavedConfigurationCommand(None) 757 script_revertToSavedConfiguration.__doc__ = _("loads NVDA configuration from file, overridingcurrent changes")757 script_revertToSavedConfiguration.__doc__ = _("loads the NVDA configuration from nvda.ini, overriding any current changes") 758 758

