Centralize list of default transaction types.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
parent
4984feef92
commit
fc2b1cb177
3 changed files with 5 additions and 2 deletions
|
|
@ -447,7 +447,7 @@ class Database:
|
|||
options["compression"] = version.compression()
|
||||
if txntype is None:
|
||||
txntype = []
|
||||
txntype.insert(0, "hash")
|
||||
txntype[0:0] = newfol.filemanip.FileStorage.DEFAULT_TRANSACTION_TYPES
|
||||
return newfol.filemanip.FileStorage(version.serialization(),
|
||||
location + "/dtb", txntype,
|
||||
options)
|
||||
|
|
|
|||
|
|
@ -545,6 +545,8 @@ class RawFile(FileFormat):
|
|||
|
||||
class FileStorage:
|
||||
"""A file (or file-like object) in a certain format."""
|
||||
DEFAULT_TRANSACTION_TYPES = ('hash',)
|
||||
|
||||
def __init__(self, fmt, filename, txnformat=None, options=None):
|
||||
txnformat = self._canonicalize_transaction_types(txnformat)
|
||||
self._txn = self._make_transaction_store(txnformat, options)
|
||||
|
|
|
|||
|
|
@ -1195,7 +1195,8 @@ def print_version(db):
|
|||
ver = db.version()
|
||||
dump_database_information(txntypes, ver)
|
||||
|
||||
dump_database_information(['hash'], DatabaseVersion.preferred(),
|
||||
default_txns = filemanip.FileStorage.DEFAULT_TRANSACTION_TYPES
|
||||
dump_database_information(default_txns, DatabaseVersion.preferred(),
|
||||
"Default ")
|
||||
print()
|
||||
print("Supported Serialization Types: " + ", ".
|
||||
|
|
|
|||
Loading…
Reference in a new issue