OSDN Git Service

Merged ticket337 branch, closes #337.
authorMichael Curran <mick@kulgan.net>
Fri, 24 Jul 2009 05:45:48 +0000 (15:45 +1000)
committerMichael Curran <mick@kulgan.net>
Fri, 24 Jul 2009 05:45:48 +0000 (15:45 +1000)
*New: Portable versions of NVDA now look in a 'userConfig' directory inside the NVDA directory, for the user's configuration. Like for the installer version, this keeps the user's configuration separate from NVDA itself.
*New: Custom app modules, braille display drivers and synth drivers can now be stored in the user's configuration directory.
*Change: AppModules, brailleDisplayDrivers and synthDrivers included in the distribution are now bundled  in to NVDA when it is compiled. This means that there are no longer any .py .pyc or .pyo files floating around a compiled copy, which has caused major problems for some people when updating from one version to another. The other major advantage is that all dependencies these modules and drivers may need will also be automatically compiled in at the same time. Also note that NVDA will no longer look for custom appModules, brailleDisplayDrivers or synthDrivers in these respective directories  in the distribution, however they can be stored in the user's config dir instead.
   *New: NVDA's log file can now be found in the user's configuration directory.  however as to not degrade flash drives,  the log file is stored in the user's temp directory if NVDA is running from a removable drive (such as a USB flash drive).

1  2 
installer/nvda.nsi
source/config/__init__.py
source/core.py
source/setup.py

Simple merge
@@@ -6,38 -6,11 +6,35 @@@ import _winre
  import os\r
  import sys\r
  from cStringIO import StringIO\r
 -from configobj import ConfigObj\r
 +from configobj import ConfigObj, ConfigObjError\r
  from validate import Validator\r
  from logHandler import log\r
- import ctypes\r
\r
- CSIDL_APPDATA=26\r
- MAX_PATH=256\r
+ import shlobj\r
  \r
 +def validateConfig(configObj,validator,validationResult=None,keyList=None):\r
 +      if validationResult is None:\r
 +              validationResult=configObj.validate(validator,preserve_errors=True)\r
 +      if validationResult is True:\r
 +              return None #No errors\r
 +      if validationResult is False:\r
 +              return _("Badly formed configuration file")\r
 +      errorStrings=[]\r
 +      for k,v in validationResult.iteritems():\r
 +              if v is True:\r
 +                      continue\r
 +              newKeyList=list(keyList) if keyList is not None else []\r
 +              newKeyList.append(k)\r
 +              if isinstance(v,dict):\r
 +                      errorStrings.extend(validateConfig(configObj[k],validator,v,newKeyList))\r
 +              else:\r
 +                      #If a key is invalid configObj does not record its default, thus we need to get and set the default manually \r
 +                      defaultValue=validator.get_default_value(configObj.configspec[k])\r
 +                      configObj[k]=defaultValue\r
 +                      if k not in configObj.defaults:\r
 +                              configObj.defaults.append(k)\r
 +                      errorStrings.append(_("%s: %s, defaulting to %s")%(k,v,defaultValue))\r
 +      return errorStrings\r
 +\r
  val = Validator()\r
  \r
  #: The configuration specification\r
diff --cc source/core.py
Simple merge
diff --cc source/setup.py
@@@ -129,9 -118,8 +118,8 @@@ setup
        }],\r
        options = {"py2exe": {\r
                "bundle_files": 3,\r
 -              "excludes": ["comInterfaces"],\r
 +              "excludes": ["comInterfaces", "Tkinter"],\r
-               "packages": ["NVDAObjects","virtualBuffers"],\r
-               "includes": getOptionalIncludes(),\r
+               "packages": ["NVDAObjects","virtualBuffers","appModules","brailleDisplayDrivers","synthDrivers"],\r
        }},\r
        data_files=[\r
                (".",glob("*.dll")+glob("*.manifest")+["builtin.dic"]),\r