CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
centralIDRegistry.CentralIDRegistry Class Reference

Public Member Functions

def __init__ (self)
 
def getMD5FromName (self, name)
 
def getNameFromMD5 (self, md5)
 
def register (self, name, md5)
 

Public Attributes

 md5toName
 
 nameToMD5
 

Detailed Description

Definition at line 3 of file centralIDRegistry.py.

Constructor & Destructor Documentation

def centralIDRegistry.CentralIDRegistry.__init__ (   self)

Member Function Documentation

def centralIDRegistry.CentralIDRegistry.getMD5FromName (   self,
  name 
)

Definition at line 26 of file centralIDRegistry.py.

References centralIDRegistry.CentralIDRegistry.nameToMD5.

26  def getMD5FromName(self,name):
27  if name in self.nameToMD5:
28  return self.nameToMD5[name]
29  else:
30  return ''
31 
32 
def centralIDRegistry.CentralIDRegistry.getNameFromMD5 (   self,
  md5 
)

Definition at line 20 of file centralIDRegistry.py.

References centralIDRegistry.CentralIDRegistry.md5toName.

20  def getNameFromMD5(self,md5):
21  if md5 in self.md5toName:
22  return self.md5toName[md5]
23  else:
24  return ''
25 
def centralIDRegistry.CentralIDRegistry.register (   self,
  name,
  md5 
)

Definition at line 8 of file centralIDRegistry.py.

References centralIDRegistry.CentralIDRegistry.md5toName, and centralIDRegistry.CentralIDRegistry.nameToMD5.

8  def register(self,name,md5):
9  #register md5 -> name
10  if md5 not in self.md5toName:
11  self.md5toName[md5] = name
12  else:
13  raise Exception('md5 %s already exists with name %s!'%(md5,self.md5toName[md5]))
14  # register name -> md5
15  if name not in self.nameToMD5:
16  self.nameToMD5[name] = md5
17  else:
18  raise Exception('Name %s already exists with md5 %s!'%(name,self.nameToMD5[name]))
19 

Member Data Documentation

centralIDRegistry.CentralIDRegistry.md5toName
centralIDRegistry.CentralIDRegistry.nameToMD5