instead
cosmetic tweaks in the config screen
row += 1
hlayout = QHBoxLayout()
row += 1
hlayout = QHBoxLayout()
- hlayout.addStretch()
- def conf_button (action,label):
+ def bottom_button (action,label,align):
button=QPushButton(label, self)
button.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
button=QPushButton(label, self)
button.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
- hlayout.addWidget(button)
+ hlayout.addWidget(button,0,align)
hlayout.addSpacing(10)
self.connect(button, SIGNAL('clicked()'), getattr(self,action))
hlayout.addSpacing(10)
self.connect(button, SIGNAL('clicked()'), getattr(self,action))
- conf_button ('load','Load Conf. Dir')
+ bottom_button ('load','Load Config Dir',Qt.AlignLeft)
# the config dir edit dialog
# the config dir edit dialog
- edit=QLineEdit (config.get_dirname(),self)
- self.store_local('config_dirname',edit)
- edit.setAttribute(Qt.WA_MacShowFocusRect, 0)
- edit.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Maximum)
- self.connect(edit,SIGNAL ('returnPressed()'), self.load)
- hlayout.addWidget (edit)
+ confdir=QLineEdit (config.get_dirname(),self)
+ self.store_local('config_dirname',confdir)
+ confdir.setAttribute(Qt.WA_MacShowFocusRect, 0)
+ confdir.setSizePolicy(QSizePolicy.Expanding,QSizePolicy.Maximum)
+ confdir.setStyleSheet("QLineEdit { width: 200px; }")
+ self.connect(confdir,SIGNAL ('returnPressed()'), self.load)
+ hlayout.addWidget (confdir,0,Qt.AlignLeft)
- conf_button ('createSlice', 'Create New Slice'),
- conf_button ('apply','Apply Only'),
- conf_button ('save','Apply && Save')
+ hlayout.addStretch()
+ bottom_button ('createSlice', 'Create New Slice', Qt.AlignRight),
+ bottom_button ('apply','Apply Only',Qt.AlignRight),
+ bottom_button ('save','Apply && Save',Qt.AlignRight)
layout = QVBoxLayout()
layout.addLayout(glayout)
layout = QVBoxLayout()
layout.addLayout(glayout)
self.save()
def apply(self):
self.save()
def apply(self):
for field in config.fields():
widget=getattr(self,field)
if isinstance(widget,QCheckBox):
for field in config.fields():
widget=getattr(self,field)
if isinstance(widget,QCheckBox):
def submitFinished(self):
self.setStatus("<font color='green'>Slice data submitted.</font>")
def submitFinished(self):
self.setStatus("<font color='green'>Slice data submitted.</font>")
- QTimer.singleShot(1000, self.refresh)
+ # no need to do that anymore
+ # QTimer.singleShot(1000, self.refresh)
+ self.updateView()
+ self.parent().signalAll("rspecUpdated")
def refreshFinished(self):
self.setStatus("<font color='green'>Slice data refreshed.</font>", timeout=5000)
def refreshFinished(self):
self.setStatus("<font color='green'>Slice data refreshed.</font>", timeout=5000)
self.disconnect(self.process, SIGNAL('finished()'), self.submitFinished)
self.connect(self.process, SIGNAL('finished()'), self.refreshFinished)
self.disconnect(self.process, SIGNAL('finished()'), self.submitFinished)
self.connect(self.process, SIGNAL('finished()'), self.refreshFinished)
- self.process.getRSpecFromSM()
+ self.process.retrieveRspec()
self.setStatus("Refreshing slice data. This will take some time...")
def updateView(self):
self.setStatus("Refreshing slice data. This will take some time...")
def updateView(self):
return self.faults[0].get("faultString","") + " (" + self.faults[0].get("faultCode","") + ")"
return self.faults[0].get("faultString","") + " (" + self.faults[0].get("faultCode","") + ")"
- def __getRSpec(self, mgr):
+ def retrieveRspec(self):
slice = config.getSlice()
slice = config.getSlice()
- # Write RSpec to file for testing.
+ mgr = config.getSlicemgr()
+ # Write RSpec to file
filename = config.fullpath ("%s.rspec"%slice)
try:
os.remove(filename)
filename = config.fullpath ("%s.rspec"%slice)
try:
os.remove(filename)
self.start()
return filename
self.start()
return filename
- def getRSpecFromSM(self):
- return self.__getRSpec(config.getSlicemgr())
-
-# def getRSpecFromAM(self):
-# return self.__getRSpec(config.getAggmgr())
def listRecords(self, hrn, rectype=None, filename=None):
args = ["-u", config.getUser(), "-a", config.getAuthority(),
def listRecords(self, hrn, rectype=None, filename=None):
args = ["-u", config.getUser(), "-a", config.getAuthority(),
self.getRecord(config.getAuthority(), config.getAuthorityRecordFile())
def applyRSpec(self, rspec):
self.getRecord(config.getAuthority(), config.getAuthorityRecordFile())
def applyRSpec(self, rspec):
- filename = config.getSliceRSpecFile() + "_new"
- rspec.save(filename)
+ # that's what we pass, like in what we'd like to get
+ requested = config.getSliceRSpecFile() + "_new"
+ # that's what we actually receive
+ # just overwrite the slice file as if we'd used 'resources'
+ obtained = config.getSliceRSpecFile()
+ rspec.save(requested)
args = ["-u", config.getUser(), "-a", config.getAuthority(),
"-r", config.getRegistry(), "-s", config.getSlicemgr(), "create",
args = ["-u", config.getUser(), "-a", config.getAuthority(),
"-r", config.getRegistry(), "-s", config.getSlicemgr(), "create",
- config.getSlice(), filename]
+ "-o", obtained,
+ config.getSlice(), requested]
self.__init_command(args)
self.start()
self.__init_command(args)
self.start()
def updateRecord(self, filename):
args = ["-u", config.getUser(), "-a", config.getAuthority(),
def updateRecord(self, filename):
args = ["-u", config.getUser(), "-a", config.getAuthority(),