From ce6815042f2b8a01c6b7d527da21f7988a37f300 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Thu, 20 Jan 2005 01:06:14 +0000 Subject: [PATCH] added optional default value to get() --- direct/src/showbase/BulletinBoard.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/direct/src/showbase/BulletinBoard.py b/direct/src/showbase/BulletinBoard.py index a6c3a62d87..036e06fed7 100755 --- a/direct/src/showbase/BulletinBoard.py +++ b/direct/src/showbase/BulletinBoard.py @@ -1,9 +1,5 @@ from direct.directnotify import DirectNotifyGlobal -# TODO: add callback mechanism when values change. -# Should we announce every change through the messenger? -# Should you be able to hang a hook on a particular name? - class BulletinBoard: """This class implements a global location for key/value pairs to be stored. Intended to prevent coders from putting global variables directly @@ -14,8 +10,8 @@ class BulletinBoard: def __init__(self): self._dict = {} - def get(self, postName): - return self._dict.get(postName) + def get(self, postName, default=None): + return self._dict.get(postName, default) def has(self, postName): return postName in self._dict