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
popcon2dropbox.CondMetaData Class Reference
Inheritance diagram for popcon2dropbox.CondMetaData:

Public Member Functions

def __init__
 
def authPath
 
def authSys
 
def destinationDatabase
 
def dumpMetadataForUpload
 
def logDbFileName
 
def records
 

Public Attributes

 datef
 
 md
 

Detailed Description

Definition at line 19 of file popcon2dropbox.py.

Constructor & Destructor Documentation

def popcon2dropbox.CondMetaData.__init__ (   self,
  fileName 
)

Definition at line 20 of file popcon2dropbox.py.

20 
21  def __init__( self, fileName ):
22  self.md = {}
23  self.datef = datetime.now()
24  with open(fileName) as jf:
25  try:
26  self.md = json.load(jf)
27  except ValueError as e:
28  errorMessage = 'CondMetaData.__init__: Problem in decoding JSON file. Original error: ' + e.message
29  raise ValueError(errorMessage)

Member Function Documentation

def popcon2dropbox.CondMetaData.authPath (   self)

Definition at line 30 of file popcon2dropbox.py.

30 
31  def authPath( self ):
32  apath = ''
33  if self.md.has_key('authenticationPath'):
34  apath = self.md.get('authenticationPath')
35  return apath
def popcon2dropbox.CondMetaData.authSys (   self)

Definition at line 36 of file popcon2dropbox.py.

36 
37  def authSys( self ):
38  asys = 1
39  if self.md.has_key('authenticationSys'):
40  asys = self.md.get('authenticationSystem')
41  return asys
def popcon2dropbox.CondMetaData.destinationDatabase (   self)

Definition at line 42 of file popcon2dropbox.py.

Referenced by popcon2dropbox.CondMetaData.dumpMetadataForUpload().

42 
43  def destinationDatabase( self ):
44  return self.md.get('destinationDatabase')
def popcon2dropbox.CondMetaData.dumpMetadataForUpload (   self,
  inputtag,
  desttag,
  comment 
)

Definition at line 51 of file popcon2dropbox.py.

References popcon2dropbox.CondMetaData.destinationDatabase().

51 
52  def dumpMetadataForUpload( self, inputtag, desttag, comment ):
53  uploadMd = {}
54  uploadMd['destinationDatabase'] = self.destinationDatabase()
55  tags = {}
56  tagInfo = {}
57  tags[ desttag ] = tagInfo
58  uploadMd['destinationTags'] = tags
59  uploadMd['inputTag'] = inputtag
60  uploadMd['since'] = None
61  datelabel = self.datef.strftime(dateformatForLabel)
62  uploadMd['userText'] = '%s : %s' %(datelabel,comment)
63  with open( '%s.txt' %fileNameForDropBox, 'wb') as jf:
64  jf.write( json.dumps( uploadMd, sort_keys=True, indent = 2 ) )
jf.write('\n')
def popcon2dropbox.CondMetaData.logDbFileName (   self)

Definition at line 45 of file popcon2dropbox.py.

45 
46  def logDbFileName( self ):
47  return self.md.get('logDbFileName')
def popcon2dropbox.CondMetaData.records (   self)

Definition at line 48 of file popcon2dropbox.py.

48 
49  def records( self ):
50  return self.md.get('records')

Member Data Documentation

popcon2dropbox.CondMetaData.datef

Definition at line 22 of file popcon2dropbox.py.

popcon2dropbox.CondMetaData.md

Definition at line 21 of file popcon2dropbox.py.