From 0b2c87846bc45e971f68abb7112867ba6bd3883b Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Sat, 30 Dec 2023 11:48:12 -0700 Subject: [PATCH] some cleanup on doc strings and comments --- src/keri/app/habbing.py | 14 +++++++++----- src/keri/core/eventing.py | 7 +++++-- src/keri/db/basing.py | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/keri/app/habbing.py b/src/keri/app/habbing.py index f5714ca15..5c1df2db0 100644 --- a/src/keri/app/habbing.py +++ b/src/keri/app/habbing.py @@ -129,8 +129,10 @@ class Habery: psr (parsing.Parser): parses local messages for .kvy .rvy habs (dict): Hab instances keyed by prefix. - To look up Hab by name get prefix from db.habs .prefix field using - .habByName + To look up Hab by name use use .habByName + To look up Hab by prefix us .habByPrefix + to get hab from db need name for key + hab prefix in db.habs record .hid field inited (bool): True means fully initialized wrt databases. False means not yet fully initialized @@ -753,7 +755,8 @@ def prefixes(self): def habByPre(self, pre): """ - Returns the Hab from and namespace including the default namespace. + Returns the Hab instance from .habs or .namespace + including the default namespace. Args: pre (str): qb64 aid of hab to find @@ -774,7 +777,8 @@ def habByPre(self, pre): def habByName(self, name, ns=None): """ Returns: - hab (Hab): instance from .habs by name if any otherwise None + hab (Hab): instance by name from .habs or .namspaces + if any otherwise None Parameters: name (str): alias of Hab @@ -1027,7 +1031,7 @@ def __init__(self, ks, db, cf, mgr, rtr, rvy, kvy, psr, *, self.psr = psr # injected self.name = name - self.ns = ns + self.ns = ns # what is this? self.pre = pre # wait to setup until after db is known to be opened self.temp = True if temp else False diff --git a/src/keri/core/eventing.py b/src/keri/core/eventing.py index e48cb71be..4fb24561a 100644 --- a/src/keri/core/eventing.py +++ b/src/keri/core/eventing.py @@ -1784,8 +1784,11 @@ def locallyOwned(self, pre): pre = pre if pre is not None else '' return pre in self.prefixes - def locallyOwnedGroup(self, pre): - """Returns True if pre is locally owned group identifier prefix. + + def locallyMembered(self, pre): + """Returns True if group hab identifier prefix has as a contributing + member a locally owned prefix + Reads habs database to figure this out. Parameters: diff --git a/src/keri/db/basing.py b/src/keri/db/basing.py index 7adc4ead1..6cde6e2de 100644 --- a/src/keri/db/basing.py +++ b/src/keri/db/basing.py @@ -778,7 +778,7 @@ class Baser(dbing.LMDBer): the associated event. So one can lookup event digest, get its fn here and then use fn to fetch event by fn from .fels. - .states (stts) is named subDB instance of SerderSuber that maps a prefix + .states (subkey stts.) is named subDB instance of SerderSuber that maps a prefix to the latest keystate for that prefix. Used by ._kevers.db for read through cache of key state to reload kevers in memory