renamed some funcs to comply with standards

This commit is contained in:
Joe Shochet 2005-01-11 00:32:30 +00:00
parent d40eb90d62
commit 9d44c1a374

View File

@ -57,7 +57,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
## Top level Interest Manager
##
self.__interest_id_assign = 1
self.__interesthash = {}
self.__interests = {}
def abruptCleanup(self):
@ -643,55 +643,51 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
## interest managment
##
##
def InterestAdd(self, parentId, zoneId, Description):
def addInterest(self, parentId, zoneId, description):
"""
Part of the new otp-server code.
"""
self.__interest_id_assign += 1
self.__interesthash[self.__interest_id_assign] = Description
self.__interests[self.__interest_id_assign] = description
contextId = self.__interest_id_assign
self.__sendAddInterest(contextId, parentId, zoneId)
self.DumpInterests()
self.printInterests()
return contextId
def InterestRemove(self, contextId):
def removeInterest(self, contextId):
"""
Part of the new otp-server code.
"""
answer = 0
if self.__interesthash.has_key(contextId):
if self.__interests.has_key(contextId):
self.__sendRemoveInterest(contextId)
del self.__interesthash[contextId]
del self.__interests[contextId]
answer = 1
self.DumpInterests()
self.printInterests()
return answer
def InterestAlter(self, contextId, parentId, zoneId, Description):
def alterInterest(self, contextId, parentId, zoneId, description):
"""
Part of the new otp-server code.
Removes old and adds new..
"""
answer = 0
if self.__interesthash.has_key(contextId):
self.__interesthash[contextId] = Description
if self.__interests.has_key(contextId):
self.__interests[contextId] = description
self.__sendAlterInterest(contextId, parentId, zoneId)
answer = 1
self.DumpInterests()
self.printInterests()
return answer
def DumpInterests(self):
def printInterests(self):
"""
Part of the new otp-server code.
"""
print "*********************** Interest Sets **************"
for i in self.__interesthash.keys():
print "Interest ID:%s, Description=%s"%(i,self.__interesthash[i])
for i in self.__interests.keys():
print "Interest ID:%s, Description=%s"%(i,self.__interests[i])
print "****************************************************"
def __sendAddInterest(self, contextId, parentId, zoneId):
"""
Part of the new otp-server code.