comparison orpg/orpgCore.py @ 10:73d9286c22cf traipse_dev

Adds some superb CherryPy features! Components can be deleted now too!
author sirebral
date Fri, 17 Jul 2009 08:13:50 -0500
parents 4385a7d0efd1
children c54768cffbd4
comparison
equal deleted inserted replaced
9:c97c641a76fd 10:73d9286c22cf
67 if self.__components.has_key(key): 67 if self.__components.has_key(key):
68 return self.__components[key] 68 return self.__components[key]
69 else: 69 else:
70 return None 70 return None
71 71
72 def del_component(self, key):
73 if self.__components.has_key(key):
74 del self.__components[key]
75 else:
76 return
77
72 def singleton(cls): 78 def singleton(cls):
73 instances = {} 79 instances = {}
74 def getinstance(): 80 def getinstance():
75 if cls not in instances: 81 if cls not in instances:
76 instances[cls] = cls() 82 instances[cls] = cls()