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 14 of file conditionUploadTest.py.

Constructor & Destructor Documentation

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

Definition at line 15 of file conditionUploadTest.py.

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

Member Function Documentation

def conditionUploadTest.DB.connect (   self)

Definition at line 20 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().

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

Definition at line 39 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

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

Definition at line 46 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

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

Definition at line 32 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

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

Member Data Documentation

conditionUploadTest.DB.connStr
conditionUploadTest.DB.schemaName

Definition at line 17 of file conditionUploadTest.py.

Referenced by conditionUploadTest.DB.connect().

conditionUploadTest.DB.serviceName

Definition at line 16 of file conditionUploadTest.py.

Referenced by conditionUploadTest.DB.connect().