X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/f982c8513663a0f9927fb04ba650a5f63bb7f21f..63ad88e2826d82b4ea7ff380784d471fa4884e3d:/forum/modules/ui.py diff --git a/forum/modules/ui.py b/forum/modules/ui.py index 48c0246..2694110 100644 --- a/forum/modules/ui.py +++ b/forum/modules/ui.py @@ -9,6 +9,16 @@ class Registry(list): self.append(item) + def find_by_name(self, name): + for i in self: + if i.name and (i.name == name): + return i + + def remove_by_name(self, name): + for i, r in enumerate(self): + if r.name and (r.name == name): + return self.pop(i) + HEAD_CONTENT = 'HEAD_CONTENT' HEADER_LINKS = 'HEADER_LINKS'