本文整理汇总了Python中Core.Organizer.clear方法的典型用法代码示例。如果您正苦于以下问题:Python Organizer.clear方法的具体用法?Python Organizer.clear怎么用?Python Organizer.clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Organizer
的用法示例。
在下文中一共展示了Organizer.clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: apply
# 需要导入模块: from Core import Organizer [as 别名]
# 或者: from Core.Organizer import clear [as 别名]
def apply(self):
self.checkCompleters()
self.reFillCompleters()
getMainTable().createHistoryPoint()
getMainTable().isAskShowHiddenColumn = True
selectedColumnKey = self.columns.currentData()
if selectedColumnKey == "all":
columnKeys = getMainTable().getWritableColumnKeys()
else:
columnKeys = [selectedColumnKey]
for columnKey in columnKeys:
columnNo = getMainTable().getColumnNoFromKey(columnKey)
if getMainTable().checkReadOnlyColumn(columnKey) is False:
continue
if getMainTable().checkHiddenColumn(columnKey, False) is False:
continue
for rowNo in range(getMainTable().rowCount()):
if getMainTable().isChangeableItem(rowNo, columnKey):
newString = str(getMainTable().item(rowNo, columnNo).text())
newString = uni.trDecode(newString, "utf-8")
informationSectionX = self.specialTools.cbInformationSectionX.value()
informationSectionY = self.specialTools.cbInformationSectionY.value()
isCaseInsensitive = self.cckbCaseInsensitive.isChecked()
oldString = str(self.leClear.text())
cbClearType = self.cbClearType.currentText()
isRegExp = self.cckbRegExp.isChecked()
myString = None
if self.specialTools.cbInformationSection.currentIndex() == 0:
myString = Organizer.clear(cbClearType, newString,
oldString, isCaseInsensitive, isRegExp)
elif self.specialTools.cbInformationSection.currentIndex() == 1:
myString = Organizer.clear(cbClearType, newString[:informationSectionX],
oldString, isCaseInsensitive, isRegExp)
myString += newString[informationSectionX:]
elif self.specialTools.cbInformationSection.currentIndex() == 2:
myString = newString[:informationSectionX]
myString += Organizer.clear(cbClearType, newString[informationSectionX:],
oldString, isCaseInsensitive, isRegExp)
elif self.specialTools.cbInformationSection.currentIndex() == 3:
myString = Organizer.clear(cbClearType, newString[:-informationSectionX],
oldString, isCaseInsensitive, isRegExp)
myString += newString[-informationSectionX:]
elif self.specialTools.cbInformationSection.currentIndex() == 4:
myString = newString[:-informationSectionX]
myString += Organizer.clear(cbClearType, newString[-informationSectionX:],
oldString, isCaseInsensitive, isRegExp)
elif self.specialTools.cbInformationSection.currentIndex() == 5:
myString = newString[:informationSectionX]
myString += Organizer.clear(cbClearType, newString[informationSectionX:informationSectionY],
oldString, isCaseInsensitive, isRegExp)
myString += newString[informationSectionY:]
elif self.specialTools.cbInformationSection.currentIndex() == 6:
myString = Organizer.clear(cbClearType, newString[:informationSectionX],
oldString, isCaseInsensitive, isRegExp)
myString += newString[informationSectionX:informationSectionY]
myString += Organizer.clear(cbClearType, newString[informationSectionY:],
oldString, isCaseInsensitive, isRegExp)
getMainTable().item(rowNo, columnNo).setText(str(myString))