CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
conditionUploadTest.DB Class Reference

Public Member Functions

def __init__ (self, serviceName, schemaName)
 
def connect (self)
 
def getLastInsertedSince (self, tag, snapshot)
 
def removeTag (self, tag)
 
def setSynchronizationType (self, tag, synchType)
 

Public Attributes

 connStr
 
 schemaName
 
 serviceName
 

Detailed Description

Definition at line 15 of file conditionUploadTest.py.

Constructor & Destructor Documentation

def conditionUploadTest.DB.__init__ (   self,
  serviceName,
  schemaName 
)

Definition at line 16 of file conditionUploadTest.py.

16  def __init__(self, serviceName, schemaName ):
17  self.serviceName = serviceName
18  self.schemaName = schemaName
19  self.connStr = None
20 
def __init__(self, serviceName, schemaName)

Member Function Documentation

def conditionUploadTest.DB.connect (   self)

Definition at line 21 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr, conditionUploadTest.DB.schemaName, conditionUploadTest.DB.serviceName, and split.

Referenced by Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.__init__(), Vispa.Views.PropertyView.BooleanProperty.__init__(), Vispa.Gui.FindDialog.FindDialog._addScript(), Vispa.Gui.FindDialog.FindDialog._addStringProperty(), Vispa.Main.Application.Application._connectSignals(), Vispa.Plugins.ConfigEditor.CodeTableView.CodeTableView._createItem(), Vispa.Gui.BoxContentDialog.BoxContentDialog.addButton(), Vispa.Gui.ToolBoxContainer.ToolBoxContainer.addWidget(), Vispa.Views.PropertyView.PropertyView.append(), Vispa.Views.PropertyView.PropertyView.appendAddRow(), Vispa.Main.Application.Application.createAction(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createButton(), Vispa.Views.LineDecayView.LineDecayView.createLineDecayContainer(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createLineEdit(), Vispa.Views.LineDecayView.LineDecayContainer.createObject(), Vispa.Views.PropertyView.TextEditWithButtonProperty.createTextEdit(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.filterDialog(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.find(), Vispa.Gui.PortWidget.PortWidget.mouseMoveEvent(), Vispa.Views.PropertyView.BooleanProperty.setChecked(), Vispa.Main.SplitterTab.SplitterTab.setController(), Vispa.Plugins.Browser.BrowserTab.BrowserTab.setController(), Vispa.Views.PropertyView.BooleanProperty.setReadOnly(), Vispa.Views.PropertyView.DropDownProperty.setReadOnly(), Vispa.Views.PropertyView.TextEditWithButtonProperty.setReadOnly(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.setTab(), Vispa.Views.PropertyView.IntegerProperty.setValue(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.switchCenterView(), o2o_db_cfgmap.DbManagerDAQ.update_hashmap(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateViewMenu().

21  def connect( self ):
22  command = "cmscond_authentication_manager -s %s --list_conn | grep '%s@%s'" %(self.serviceName,self.schemaName,self.serviceName)
23  pipe = subprocess.Popen( command, shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
24  out = pipe.communicate()[0]
25  srvconn = '%s@%s' %(self.schemaName,self.serviceName)
26  rowpwd = out.split(srvconn)[1].split(self.schemaName)[1]
27  pwd = ''
28  for c in rowpwd:
29  if c != ' ' and c != '\n':
30  pwd += c
31  self.connStr = '%s/%s@%s' %(self.schemaName,pwd,self.serviceName)
32 
double split
Definition: MVATrainer.cc:139
def conditionUploadTest.DB.getLastInsertedSince (   self,
  tag,
  snapshot 
)

Definition at line 40 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

40  def getLastInsertedSince( self, tag, snapshot ):
41  db = cx_Oracle.connect(self.connStr)
42  cursor = db.cursor()
43  cursor.execute('SELECT SINCE, INSERTION_TIME FROM IOV WHERE TAG_NAME =:TAG_NAME AND INSERTION_TIME >:TIME ORDER BY INSERTION_TIME DESC',(tag,snapshot))
44  row = cursor.fetchone()
45  return row
46 
def getLastInsertedSince(self, tag, snapshot)
def conditionUploadTest.DB.removeTag (   self,
  tag 
)

Definition at line 47 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

47  def removeTag( self, tag ):
48  db = cx_Oracle.connect(self.connStr)
49  cursor = db.cursor()
50  db.begin()
51  cursor.execute('DELETE FROM IOV WHERE TAG_NAME =:TAG_NAME',(tag,))
52  cursor.execute('DELETE FROM TAG_LOG WHERE TAG_NAME=:TAG_NAME',(tag,))
53  cursor.execute('DELETE FROM TAG WHERE NAME=:NAME',(tag,))
54  db.commit()
55 
def conditionUploadTest.DB.setSynchronizationType (   self,
  tag,
  synchType 
)

Definition at line 33 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

33  def setSynchronizationType( self, tag, synchType ):
34  db = cx_Oracle.connect(self.connStr)
35  cursor = db.cursor()
36  db.begin()
37  cursor.execute('UPDATE TAG SET SYNCHRONIZATION =:SYNCH WHERE NAME =:NAME',(synchType,tag,))
38  db.commit()
39 
def setSynchronizationType(self, tag, synchType)

Member Data Documentation

conditionUploadTest.DB.connStr
conditionUploadTest.DB.schemaName

Definition at line 18 of file conditionUploadTest.py.

Referenced by conditionUploadTest.DB.connect().

conditionUploadTest.DB.serviceName

Definition at line 17 of file conditionUploadTest.py.

Referenced by conditionUploadTest.DB.connect().