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

◆ __init__()

def centralIDRegistry.CentralIDRegistry.__init__ (   self)

Definition at line 4 of file centralIDRegistry.py.

4  def __init__(self):
5  self.md5toName = {}
6  self.nameToMD5 = {}
7 

Member Function Documentation

◆ getMD5FromName()

def centralIDRegistry.CentralIDRegistry.getMD5FromName (   self,
  name 
)

Definition at line 26 of file centralIDRegistry.py.

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

References centralIDRegistry.CentralIDRegistry.nameToMD5.

◆ getNameFromMD5()

def centralIDRegistry.CentralIDRegistry.getNameFromMD5 (   self,
  md5 
)

Definition at line 20 of file centralIDRegistry.py.

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

References centralIDRegistry.CentralIDRegistry.md5toName.

◆ register()

def centralIDRegistry.CentralIDRegistry.register (   self,
  name,
  md5 
)

Definition at line 8 of file centralIDRegistry.py.

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.value() not in self.nameToMD5:
16  self.nameToMD5[name.value()] = md5
17  else:
18  raise Exception('Name %s already exists with md5 %s!'%(name.value(),self.nameToMD5[name.value()]))
19 

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

Member Data Documentation

◆ md5toName

centralIDRegistry.CentralIDRegistry.md5toName

◆ nameToMD5

centralIDRegistry.CentralIDRegistry.nameToMD5
Exception