This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/2553 util: simplify listdict listdict came into the code base from some other python code of mine, for no apparent reason: it is actually not used here at all. However, an upcoming patch will use a dict of lists. Also, the listdict implementation is convoluted/complex (to allow accessing keys as direct object members, which we don't need). Simplify the implementation to be used by I0939ef414bc599ee8742df48da04d8d9569d00ba. Change-Id: I09adfd128a19c6c5ba36aae1d4cab83dbd07e0fb --- M src/osmo_gsm_tester/util.py 1 file changed, 6 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/53/2553/1 diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py index 9a4e728..19d5bd0 100644 --- a/src/osmo_gsm_tester/util.py +++ b/src/osmo_gsm_tester/util.py @@ -38,34 +38,20 @@ return path return path + ':' + lp -class listdict: +class listdict(dict): 'a dict of lists { "a": [1, 2, 3], "b": [1, 2] }' - def __getattr__(ld, name): - if name == 'add': - return ld.__getattribute__(name) - return ld.__dict__.__getattribute__(name) - def add(ld, name, item): - l = ld.__dict__.get(name) + def add(self, name, item): + l = self.get(name) if not l: l = [] - ld.__dict__[name] = l + self[name] = l l.append(item) return l - def add_dict(ld, d): + def add_dict(self, d): for k,v in d.items(): - ld.add(k, v) - - def __setitem__(ld, name, val): - return ld.__dict__.__setitem__(name, val) - - def __getitem__(ld, name): - return ld.__dict__.__getitem__(name) - - def __str__(ld): - return ld.__dict__.__str__() - + self.add(k, v) class DictProxy: ''' -- To view, visit https://gerrit.osmocom.org/2553 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09adfd128a19c6c5ba36aae1d4cab83dbd07e0fb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>