X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/blobdiff_plain/2abe74251ed389f76cd990de4b05658857ea30af..4a35c9a728df05a99eff3c335ee7ec2ddf201cff:/catacomb/pwsafe.py?ds=inline diff --git a/catacomb/pwsafe.py b/catacomb/pwsafe.py index 65aec71..1e8e4db 100644 --- a/catacomb/pwsafe.py +++ b/catacomb/pwsafe.py @@ -161,17 +161,17 @@ class PW (object): using the stored keys. """ - def __init__(me, file, mode = 'r'): + def __init__(me, file, writep = False): """ Initialize a PW object from the GDBM database in FILE. - MODE can be `r' for read-only access to the underlying database, or `w' - for read-write access. Requests the database password from the Pixie, + If WRITEP is true, then allow write-access to the database; otherwise + allow read access only. Requests the database password from the Pixie, which may cause interaction. """ ## Open the database. - me.db = _G.open(file, mode) + me.db = _G.open(file, writep and 'w' or 'r') ## Find out what crypto to use. c = _C.gcciphers[me.db['cipher']]