Mercurial > p > roundup > code
view scripts/dump_dbm_sessions_db.py @ 6721:c6dc2e8d59a8
Try to fix install failure for xapian on 3.11-dev and newer.
distutils.sysconfig.get_config_vars('SO') is returning None on these
platforms. Use: sysconfig.get_config_vars('SO') instead. This works
with my 3.6 install, so hopefully will work with all of the 3.x
releases we have.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 23 Jun 2022 01:24:58 -0400 |
| parents | 61481d7bbb07 |
| children | 1188bb423f92 |
line wrap: on
line source
#! /usr/bin/env python3 """Usage: dump_dbm_sessions_db.py [filename] Simple script to dump the otks and sessions dbm databases. Dumps sessions db in current directory if no argument is given. Dump format: key: <timestamp> data where <timestamp> is the human readable __timestamp decoded from the data object. """ import dbm, marshal, sys from datetime import datetime try: file = sys.argv[1] except IndexError: file="sessions" try: db = dbm.open(file) except Exception: print("Unable to open database: %s"%file) exit(1) k = db.firstkey() while k is not None: d = marshal.loads(db[k]) t = datetime.fromtimestamp(d['__timestamp']) print("%s: %s %s"%(k, t, d)) k = db.nextkey(k)
