Commit a2e4dd23 authored by Kirill Smelkov's avatar Kirill Smelkov

zodbinfo: Provide "head" as command to query DB head; Turn "last_tid" into...

zodbinfo: Provide "head" as command to query DB head; Turn "last_tid" into deprecated alias for head

Similarly to go version: neo@151d8b79.
parent 0b6f99da
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
# Copyright (C) 2017-2020 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
......@@ -25,11 +25,16 @@ from collections import OrderedDict
from golang import func, defer
import sys
def _last_tid(stor):
print("W: last_tid is deprecated alias for head", file=sys.stderr)
return infoDict["head"](stor)
# {} parameter_name -> get_parameter(stor)
infoDict = OrderedDict([
("name", lambda stor: stor.getName()),
("size", lambda stor: stor.getSize()),
("last_tid", lambda stor: ashex(stor.lastTransaction())),
("head", lambda stor: ashex(stor.lastTransaction())),
("last_tid", _last_tid),
])
def zodbinfo(stor, parameterv):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment