test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
centralIDRegistry.CentralIDRegistry Class Reference

Public Member Functions

def __init__
 
def getMD5FromName
 
def getNameFromMD5
 
def register
 

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 
27  def getMD5FromName(self,name):
28  if name in self.nameToMD5:
29  return self.nameToMD5[name]
30  else:
31  return ''
32 
def centralIDRegistry.CentralIDRegistry.getNameFromMD5 (   self,
  md5 
)

Definition at line 20 of file centralIDRegistry.py.

References centralIDRegistry.CentralIDRegistry.md5toName.

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

Definition at line 8 of file centralIDRegistry.py.

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

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

Member Data Documentation

centralIDRegistry.CentralIDRegistry.md5toName

Definition at line 5 of file centralIDRegistry.py.

Referenced by centralIDRegistry.CentralIDRegistry.getNameFromMD5(), and centralIDRegistry.CentralIDRegistry.register().

centralIDRegistry.CentralIDRegistry.nameToMD5

Definition at line 6 of file centralIDRegistry.py.

Referenced by centralIDRegistry.CentralIDRegistry.getMD5FromName(), and centralIDRegistry.CentralIDRegistry.register().