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
conditionUploadTest.DB Class Reference

Public Member Functions

def __init__
 
def connect
 
def getLastInsertedSince
 
def removeTag
 
def setSynchronizationType
 

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 
16  def __init__(self, serviceName, schemaName ):
17  self.serviceName = serviceName
18  self.schemaName = schemaName
19  self.connStr = None

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(), Vispa.Plugins.EdmBrowser.EdmBrowserTabController.EdmBrowserTabController.updateViewMenu(), and Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.updateViewMenu().

20 
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)
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 
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
def conditionUploadTest.DB.removeTag (   self,
  tag 
)

Definition at line 46 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

46 
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 WHERE NAME=:NAME',(tag,))
53  db.commit()
def conditionUploadTest.DB.setSynchronizationType (   self,
  tag,
  synchType 
)

Definition at line 32 of file conditionUploadTest.py.

References conditionUploadTest.DB.connStr.

32 
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()

Member Data Documentation

conditionUploadTest.DB.connStr

Definition at line 18 of file conditionUploadTest.py.

Referenced by conditionUploadTest.DB.connect(), conditionUploadTest.DB.getLastInsertedSince(), conditionUploadTest.DB.removeTag(), and conditionUploadTest.DB.setSynchronizationType().

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().