From 67b8794397ca2ac4e05c59fc417456f4d4cac8f0 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 7 Nov 2008 18:41:14 +0100 Subject: [PATCH] add ResourceManager for handling resources in inter plugin communication --- lib/python/Components/Makefile.am | 2 +- lib/python/Components/ResourceManager.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 lib/python/Components/ResourceManager.py diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index fda58bf3..9c04701b 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -18,4 +18,4 @@ install_PYTHON = \ MultiContent.py MediaPlayer.py TunerInfo.py VideoWindow.py ChoiceList.py \ Element.py Playlist.py ParentalControl.py ParentalControlList.py \ Ipkg.py SelectionList.py Scanner.py SystemInfo.py DreamInfoHandler.py \ - Task.py language_cache.py Console.py + Task.py language_cache.py Console.py ResourceManager.py diff --git a/lib/python/Components/ResourceManager.py b/lib/python/Components/ResourceManager.py new file mode 100644 index 00000000..fb6be4a8 --- /dev/null +++ b/lib/python/Components/ResourceManager.py @@ -0,0 +1,23 @@ +class ResourceManager: + def __init__(self): + self.resourceList = {} + + def addResource(self, name, resource): + print "adding Resource", name + self.resourceList[name] = resource + print "resources:", self.resourceList + + + def getResource(self, name): + if not self.hasResource(name): + return None + return self.resourceList[name] + + def hasResource(self, name): + return self.resourceList.has_key(name) + + def removeResource(self, name): + if self.hasResource(name): + del self.resourceList[name] + +resourcemanager = ResourceManager() \ No newline at end of file -- 2.30.2