Package config
[hide private]
[frames] | no frames]

Package config

source code

Manages NVDA configuration.

Functions [hide private]
 
validateConfig(configObj, validator, validationResult=None, keyList=None) source code
 
load()
Loads the configuration from the configFile.
source code
 
save()
Saves the configuration to the config file.
source code
 
saveOnExit()
Save the configuration if configured to save on exit.
source code
 
isInstalledCopy()
Checks to see if this running copy of NVDA is installed on the system
source code
 
getUserDefaultConfigPath() source code
 
getSystemConfigPath() source code
 
initConfigPath(configPath=None)
Creates the current configuration path if it doesn't exist.
source code
 
getStartAfterLogon() source code
 
setStartAfterLogon(enable) source code
 
isServiceInstalled() source code
 
execElevated(path, params=None, wait=False) source code
 
getStartOnLogonScreen() source code
 
_setStartOnLogonScreen(enable) source code
 
setSystemConfigToCurrentConfig() source code
 
_setSystemConfig(fromPath) source code
 
setStartOnLogonScreen(enable) source code
list of str
getConfigDirs(subpath=None)
Retrieve all directories that should be used when searching for configuration.
source code
 
addConfigDirsToPythonPackagePath(module, subdir=None)
Add the configuration directories to the module search path (__path__) of a Python package.
source code
Variables [hide private]
  val = Validator()
  confspec = ConfigObj(StringIO("""# NVDA Configuration Fi...
  conf = None
hash(x)
  synthSpec = None
hash(x)
  RUN_REGKEY = ur"SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
  SERVICE_FILENAME = u"nvda_service.exe"
  SLAVE_FILENAME = u"nvda_slave.exe"
  NVDA_REGKEY = ur"SOFTWARE\NVDA"
Function Details [hide private]

load()

source code 

Loads the configuration from the configFile. It also takes note of the file's modification time so that save won't lose any changes made to the file while NVDA is running.

saveOnExit()

source code 

Save the configuration if configured to save on exit. This should only be called if NVDA is about to exit. Errors are ignored.

initConfigPath(configPath=None)

source code 

Creates the current configuration path if it doesn't exist. Also makes sure that various sub directories also exist.

Parameters:
  • configPath (basestring) - an optional path which should be used instead (only useful when being called from outside of NVDA)

getConfigDirs(subpath=None)

source code 

Retrieve all directories that should be used when searching for configuration. IF subpath is provided, it will be added to each directory returned.

Parameters:
  • subpath (str) - The path to be added to each directory, None for none.
Returns: list of str
The configuration directories in the order in which they should be searched.

addConfigDirsToPythonPackagePath(module, subdir=None)

source code 

Add the configuration directories to the module search path (__path__) of a Python package. subdir is added to each configuration directory. It defaults to the name of the Python package.

Parameters:
  • module (module) - The root module of the package.
  • subdir (str) - The subdirectory to be used, None for the name of module.

Variables Details [hide private]

confspec

Value:
ConfigObj(StringIO("""# NVDA Configuration File

[general]
	language = string(default="Windows")
	saveConfigurationOnExit = boolean(default=False)
	askToExit = boolean(default=true)
	#possible log levels are DEBUG, IO, DEBUGWARNING, INFO
	loggingLevel = string(default="INFO")
...