Skip to content

Commit bdedb60

Browse files
authored
Merge 2a5a5ce into cdfda57
2 parents cdfda57 + 2a5a5ce commit bdedb60

File tree

16 files changed

+237
-48
lines changed

16 files changed

+237
-48
lines changed

devDocs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_build/
2+
*.rst

devDocs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

devDocs/conf.py

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#A part of NonVisual Desktop Access (NVDA)
2+
#Copyright (C) 2019 NV Access Limited, Leonard de RUijter
3+
#This file is covered by the GNU General Public License.
4+
#See the file COPYING for more details.
5+
6+
# Configuration file for the Sphinx documentation builder.
7+
8+
# -- Path setup --------------------------------------------------------------
9+
10+
import os
11+
import sys
12+
sys.path.insert(0, os.path.abspath('../source'))
13+
import sourceEnv
14+
15+
# Initialize languageHandler so that sphinx is able to deal with translatable strings.
16+
import languageHandler
17+
languageHandler.setLanguage("en")
18+
19+
# Initialize globalvars.appArgs to something sensible.
20+
import globalVars
21+
class AppArgs:
22+
# Set an empty comnfig path
23+
# This is never used as we don't initialize config, but some modules expect this to be set.
24+
configPath = ""
25+
secure = False
26+
disableAddons = True
27+
launcher = False
28+
globalVars.appArgs = AppArgs()
29+
30+
# Import NVDA's versionInfo module.
31+
import versionInfo
32+
# Set a suitable updateVersionType for the updateCheck module to be imported
33+
versionInfo.updateVersionType = "stable"
34+
35+
# -- Project information -----------------------------------------------------
36+
37+
project = versionInfo.name
38+
copyright = versionInfo.copyright
39+
author = versionInfo.publisher
40+
41+
# The major project version
42+
version = versionInfo.formatVersionForGUI(versionInfo.version_year, versionInfo.version_major, versionInfo.version_minor)
43+
44+
# The full version, including alpha/beta/rc tags
45+
release = versionInfo.version
46+
47+
# -- General configuration ---------------------------------------------------
48+
49+
default_role = 'py:obj'
50+
51+
# Add any Sphinx extension module names here, as strings. They can be
52+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
53+
# ones.
54+
extensions = [
55+
'sphinx.ext.autodoc',
56+
]
57+
58+
# Add any paths that contain templates here, relative to this directory.
59+
templates_path = ['_templates']
60+
61+
# List of patterns, relative to source directory, that match files and
62+
# directories to ignore when looking for source files.
63+
# This pattern also affects html_static_path and html_extra_path.
64+
exclude_patterns = [
65+
"_build"
66+
]
67+
68+
69+
# -- Options for HTML output -------------------------------------------------
70+
71+
# The theme to use for HTML and HTML Help pages.
72+
73+
html_theme = 'alabaster'
74+
75+
# Add any paths that contain custom static files (such as style sheets) here,
76+
# relative to this directory. They are copied after the builtin static files,
77+
# so a file named "default.css" will overwrite the builtin "default.css".
78+
html_static_path = ['_static']
79+
80+
# -- Extension configuration -------------------------------------------------
81+
82+
# sphinx.ext.autodoc configuration
83+
84+
autoclass_content = "both" # Both the class’ and the __init__ method’s docstring are concatenated and inserted.
85+
autodoc_member_order = 'bysource'
86+
autodoc_mock_imports = [
87+
"config",
88+
"louis",
89+
]
90+
91+
# SUpport for auto generation of API docs
92+
# Based on code published in https://github.com/readthedocs/readthedocs.org/issues/1139#issuecomment-398083449
93+
94+
def run_apidoc(_):
95+
ignore_paths = [
96+
'_buildVersion.py',
97+
'comInterfaces',
98+
'images',
99+
'lib',
100+
'lib64',
101+
'libArm64',
102+
'locale',
103+
'louis', # Not our project
104+
'typelibs',
105+
'waves',
106+
"mathType.py", # Fails when not installed
107+
'oleTypes.py', # Not our code
108+
'setup.py', # Py2exe
109+
'sourceEnv.py', # Only available when running from source
110+
]
111+
argv = [
112+
"--force", # overwrite existing files
113+
"-P", # Include private modules
114+
"--module-first", # put module documentation before submodule documentation
115+
"--output-dir", ".",
116+
sys.path[0] # Module sources
117+
] + [os.path.join(sys.path[0], path) for path in ignore_paths]
118+
119+
from sphinx.ext import apidoc
120+
apidoc.main(argv)
121+
122+
def setup(app):
123+
app.connect('builder-inited', run_apidoc)

devDocs/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. NVDA documentation master file, created by
2+
sphinx-quickstart on Sat Jul 20 08:52:09 2019.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to NVDA's documentation!
7+
================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
Indices and tables
16+
==================
17+
18+
* :ref:`genindex`
19+
* :ref:`modindex`
20+
* :ref:`search`

devDocs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

source/COMRegistrationFixes/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def registerServer(fileName,wow64=False):
2323
"""
2424
Registers the COM proxy dll with the given file name
2525
Using regsvr32.
26-
@ param fileName: the path to the dll
26+
@param fileName: the path to the dll
2727
@type fileName: str
2828
@param wow64: If true then the 32 bit (wow64) version of regsvr32 will be used.
2929
@type wow64: bool
@@ -40,7 +40,7 @@ def applyRegistryPatch(fileName,wow64=False):
4040
"""
4141
Applies the registry patch with the given file name
4242
using regedit.
43-
@ param fileName: the path to the dll
43+
@param fileName: the path to the dll
4444
@type fileName: str
4545
"""
4646
regedit=os.path.join(sysWow64 if wow64 else systemRoot,'regedit.exe')

source/NVDAObjects/IAccessible/sysTreeView32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import speech
1313
import UIAHandler
1414
from . import IAccessible
15-
if UIAHandler.isUIAAvailable: from ..UIA import UIA
15+
from ..UIA import UIA
1616
from .. import NVDAObject
1717
from logHandler import log
1818
import watchdog

source/NVDAObjects/UIA/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _get_controlFieldNVDAObjectClass(self):
9090
UIAHandler.UIA_AriaPropertiesPropertyId,
9191
UIAHandler.UIA_LevelPropertyId,
9292
UIAHandler.UIA_IsEnabledPropertyId,
93-
} if UIAHandler.isUIAAvailable else set()
93+
}
9494

9595
def _get__controlFieldUIACacheRequest(self):
9696
""" The UIA cacheRequest object that will be used when fetching all UIA elements needed when generating control fields for this TextInfo's content."""
@@ -108,7 +108,7 @@ def _get__controlFieldUIACacheRequest(self):
108108
UIAHandler.TextUnit_Format,
109109
UIAHandler.TextUnit_Word,
110110
UIAHandler.TextUnit_Character
111-
] if UIAHandler.isUIAAvailable else []
111+
]
112112

113113
def find(self,text,caseSensitive=False,reverse=False):
114114
tempRange=self._rangeObj.clone()
@@ -132,10 +132,10 @@ def find(self,text,caseSensitive=False,reverse=False):
132132
def _getFormatFieldAtRange(self,textRange,formatConfig,ignoreMixedValues=False):
133133
"""
134134
Fetches formatting for the given UI Automation Text range.
135-
@ param textRange: the text range whos formatting should be fetched.
135+
@param textRange: the text range whos formatting should be fetched.
136136
@type textRange: L{UIAutomation.IUIAutomationTextRange}
137137
@param formatConfig: the types of formatting requested.
138-
@ type formatConfig: a dictionary of NVDA document formatting configuration keys with values set to true for those types that should be fetched.
138+
@type formatConfig: a dictionary of NVDA document formatting configuration keys with values set to true for those types that should be fetched.
139139
@param ignoreMixedValues: If True, formatting that is mixed according to UI Automation will not be included. If False, L{UIAUtils.MixedAttributeError} will be raised if UI Automation gives back a mixed attribute value signifying that the caller may want to try again with a smaller range.
140140
@type: bool
141141
@return: The formatting for the given text range.
@@ -379,16 +379,16 @@ def _get_bookmark(self):
379379
UIAHandler.UIA_TabItemControlTypeId,
380380
UIAHandler.UIA_TextControlTypeId,
381381
UIAHandler.UIA_SplitButtonControlTypeId
382-
} if UIAHandler.isUIAAvailable else None
382+
}
383383

384384

385385
def _getControlFieldForObject(self, obj,isEmbedded=False,startOfNode=False,endOfNode=False):
386386
"""
387387
Fetch control field information for the given UIA NVDAObject.
388-
@ param obj: the NVDAObject the control field is for.
388+
@param obj: the NVDAObject the control field is for.
389389
@type obj: L{UIA}
390390
@param isEmbedded: True if this NVDAObject is for a leaf node (has no useful children).
391-
@ type isEmbedded: bool
391+
@type isEmbedded: bool
392392
@param startOfNode: True if the control field represents the very start of this object.
393393
@type startOfNode: bool
394394
@param endOfNode: True if the control field represents the very end of this object.
@@ -448,7 +448,7 @@ def _getTextWithFields_text(self,textRange,formatConfig,UIAFormatUnits=None):
448448
@param textRange: the UI Automation text range to walk.
449449
@type textRange: L{UIAHandler.IUIAutomationTextRange}
450450
@param formatConfig: the types of formatting requested.
451-
@ type formatConfig: a dictionary of NVDA document formatting configuration keys with values set to true for those types that should be fetched.
451+
@type formatConfig: a dictionary of NVDA document formatting configuration keys with values set to true for those types that should be fetched.
452452
@param UIAFormatUnits: the UI Automation text units (in order of resolution) that should be used to split the text so as to avoid mixed attribute values. This is None by default.
453453
If the parameter is a list of 1 or more units, The range will be split by the first unit in the list, and this method will be recursively run on each subrange, with the remaining units in this list given as the value of this parameter.
454454
If this parameter is an empty list, then formatting and text is fetched for the entire range, but any mixed attribute values are ignored and no splitting occures.
@@ -502,9 +502,9 @@ def _getTextWithFieldsForUIARange(self,rootElement,textRange,formatConfig,includ
502502
@param textRange: the UI Automation text range whos content should be fetched.
503503
@type textRange: L{UIAHandler.IUIAutomation}
504504
@param formatConfig: the types of formatting requested.
505-
@ type formatConfig: a dictionary of NVDA document formatting configuration keys with values set to true for those types that should be fetched.
505+
@type formatConfig: a dictionary of NVDA document formatting configuration keys with values set to true for those types that should be fetched.
506506
@param includeRoot: If true, then a control start and end will be yielded for the root element.
507-
@ type includeRoot: bool
507+
@type includeRoot: bool
508508
@param alwaysWalkAncestors: If true then control fields will be yielded for any element enclosing the given text range, that is a descendant of the root element. If false then the root element may be assumed to be the only ancestor.
509509
@type alwaysWalkAncestors: bool
510510
@param recurseChildren: If true, this function will be recursively called for each child of the given text range, clipped to the bounds of this text range. Formatted text between the children will also be yielded. If false, only formatted text will be yielded.
@@ -1186,7 +1186,7 @@ def _get_keyboardShortcut(self):
11861186
UIAHandler.UIA_IsSelectionItemPatternAvailablePropertyId,
11871187
UIAHandler.UIA_IsEnabledPropertyId,
11881188
UIAHandler.UIA_IsOffscreenPropertyId,
1189-
} if UIAHandler.isUIAAvailable else set()
1189+
}
11901190

11911191
def _get_states(self):
11921192
states=set()

source/NVDAObjects/window/excel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class ExcelQuicknavIterator(object):
328328
def __init__(self, itemType , document , direction , includeCurrent):
329329
"""
330330
See L{QuickNavItemIterator} for itemType, document and direction definitions.
331-
@ param includeCurrent: if true then any item at the initial position will be also emitted rather than just further ones.
331+
@param includeCurrent: if true then any item at the initial position will be also emitted rather than just further ones.
332332
"""
333333
self.document=document
334334
self.itemType=itemType
@@ -1106,7 +1106,7 @@ def QuickNavItemClass(self):
11061106
def __init__(self, itemType , document , direction , includeCurrent):
11071107
"""
11081108
See L{QuickNavItemIterator} for itemType, document and direction definitions.
1109-
@ param includeCurrent: if true then any item at the initial position will be also emitted rather than just further ones.
1109+
@param includeCurrent: if true then any item at the initial position will be also emitted rather than just further ones.
11101110
"""
11111111
self.document=document
11121112
self.itemType=itemType

source/NVDAObjects/window/winword.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def __init__(self,itemType,document,direction,rangeObj,includeCurrent):
444444
"""
445445
See L{QuickNavItemIterator} for itemType, document and direction definitions.
446446
@param rangeObj: a Microsoft Word range object where the collection should be fetched from.
447-
@ param includeCurrent: if true then any item at the initial position will be also emitted rather than just further ones.
447+
@param includeCurrent: if true then any item at the initial position will be also emitted rather than just further ones.
448448
"""
449449
self.document=document
450450
self.itemType=itemType

0 commit comments

Comments
 (0)