view scripts/dump_dbm_sessions_db.py @ 6620:b7093aa16895

issue2551196 - Unset labelprop of a Multilink can lead to Python error when using context/history Fix history by adding default string value to calls to link_class.get(). Mark as translatable string. Include originally identified multilink path and apply same fix to link path. Also fix a possible issue in the plain() display paths for link/multilink the same way if the label is missing. Update translation files.
author John Rouillard <rouilj@ieee.org>
date Sat, 05 Mar 2022 18:55:50 -0500
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)

Roundup Issue Tracker: http://roundup-tracker.org/