本文整理汇总了Python中configuration.Configuration.setProfileList方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.setProfileList方法的具体用法?Python Configuration.setProfileList怎么用?Python Configuration.setProfileList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.setProfileList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delCurrentProfile
# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import setProfileList [as 别名]
def delCurrentProfile(self):
i = self.ui.comboProfiles.currentIndex()
currentProfile = unicode(self.ui.comboProfiles.currentText())
if i == 0: return
conf = Configuration()
profiles = conf.getProfileList()
profiles = [ p for p in profiles if p != currentProfile ]
conf.setProfileList(profiles)
self.refreshProfiles()
self.ui.comboProfiles.setCurrentIndex(0)
示例2: addProfile
# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import setProfileList [as 别名]
def addProfile(self):
profName, ok = QtGui.QInputDialog.getText(self,
self.tr("New Profile"), self.tr('Name:'))
profName = unicode(profName)
if ok and profName != '':
conf = Configuration()
profiles = conf.getProfileList()
for p in profiles:
if p == profName: return
profiles.append(profName)
conf.setProfileList(profiles)
self.refreshProfiles()
i = self.ui.comboProfiles.findText(profName)
self.ui.comboProfiles.setCurrentIndex(i)