• Kipp Cannon's avatar
    dbtables: implement working copy mechanism as context manager · 2f7d9758
    Kipp Cannon authored
    - removes the need to install a hook into the NamedTemporaryFile instance to delete the corresponding -journal file in the event of program termination.  clean-up is the responsibility of the context manager.
    - backwards compatibility wrappers are provided
    - a small change in calling code is, however, required:  in all calling codes, must change connect(tmpname) to connect(str(tmpname)).  this can be done in advance of the python-ligo-lw release.
    - fixes issue #!14
    - include set_temp_store_directory() method in context manager, deprecate module-level equivalent
    2f7d9758
dbtables.py 35.8 KB