#appModuleHandler.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2007 NVDA Contributors
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""Manages appModules.
@var default: holds the default appModule.
@type default: appModule
@var runningTable: a dictionary of the currently running appModules, using their application's main window handle as a key.
@type runningTable: dict
@var re_keyScript: a compiled regular expression that can grab a keyName and a script name from a line in a NVDA key map file (kbd file).
@type re_keyScript: regular expression
"""
import imp
import itertools
import re
import ctypes
import os
import baseObject
import globalVars
from logHandler import log
import speech
import winUser
import winKernel
import config
import NVDAObjects #Catches errors before loading default appModule
import api
#This is here so that the appModules are able to import modules from the appModules dir themselves
__path__=['.\\appModules']
#Dictionary of processID:appModule paires used to hold the currently running modules
runningTable={}
#: The process ID of NVDA itself.
NVDAProcessID=None
#regexp to collect the key and script from a line in a keyMap file
re_keyScript=re.compile(r'^\s*(?P[\S]+)\s*=\s*(?P