This is not used anywhere. In current python versions, basicConfig
is called automatically when there is no root handler. It is easy
to add a FileHandler if required.
So this was a lot of work...
Updated to use lxml, steep learning curve for someone who never examined XML before...
The merge test code needed some updates because it was last used with an older version of the Gramps XML.
Found another bug in the mergefamilyquery code when test started running; another nonetype issue.
Found another bug in the mergepersonquery code when test started running; another nonetype issue.
Couldn't get the subprocess stuff to work right, so changed code to just call Gramps with capture, similar to export_tests. This in turn required that importxml and exportxml be slightly changed to support StringIO redirection of stdin and stdout.
And test_util needed a change to allow stdout to accept an unencoded stream, so I added an option to use BytesIO for this test as well.
Added some code to save input, result, and expected data to files in Gramps temp directory for debugging whenever an error occurred. Easier to use my editor in diff mode than look at the outputs.
database consistently check that the database exists and is open. Add a
few missing checks. Remove redundant load and direct close of dummy
database on closure.
db.select() has become db._select()
This commit refactors database._tables so that they can work properly
after a proxy or filter has been removed.
It adds abstract API called QuerySet which allows a variety of
selections and ordering of data.
Logging was added to sqlite to better see db access.
Additional fixes:
* clearing GenericDB._directory
* test_util_test off-by-one error
The problem is really that the paths get munged into strings in the
system codepage, losing or misinterpreting most Unicode. Python's os
module is smart enough to encode the unicode to the file system
encoding, but the bsddb module needs a little help.
Provide a new function, constfunc.get_env_var(name, default=None) to
cleanly import Unicode environment variables in Windows and use it in
place of all instances of foo = os.environ['BAR] or foo =
os.environ.get('BAR').
Os path functions are smart enough to convert unicode to the file system
encoding on their own, but Db functions aren't, so provide an _encode
function in gen.db.write.py and apply it where a path is being passed to
DBEnv.open().
Also convert paths from the UI to unicode from 'utf8' rather than
sysfilesystemencoding. The latter happens to be correct most of the time
on Linux and OSX but is wrong on Windows.
This does patch updates Gramps to the 3.2 syntax, it does not yet mean Gramps works with python 3.2
Expect next day commits to fix further issues, but this is the main 2to3 tool created patch changed
where needed to have python 2.7 work.
Specific issues might be:
1. next has been changed, must be checked
2. new division as on the wiki page listed is to do
3. ...
svn: r20634