本文整理汇总了Python中Core.Dialogs.show方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.show方法的具体用法?Python Dialogs.show怎么用?Python Dialogs.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Dialogs
的用法示例。
在下文中一共展示了Dialogs.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getTagger
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def getTagger(_isAlertIfNotExist=False, _isReloadAgain=False):
global loaddedTagger
try:
if not _isReloadAgain and loaddedTagger is not None:
return loaddedTagger
preferedTaggerModule = uni.MySettings["preferedTaggerModule"]
taggerModule = __import__("Taggers." + preferedTaggerModule, globals(), locals(), ["isAvailable", "Tagger", preferedTaggerModule], 0)
if taggerModule.isAvailable:
loaddedTagger = taggerModule.Tagger()
return loaddedTagger
taggersNames = uni.getTaggersMachineNames()
for tagger in taggersNames:
taggerModule = __import__("Taggers." + tagger, globals(), locals(), ["isAvailable", "Tagger", tagger], 0)
if taggerModule.isAvailable:
uni.setMySetting("preferedTaggerModule", tagger)
loaddedTagger = taggerModule.Tagger()
return loaddedTagger
if _isAlertIfNotExist:
Dialogs.show(translate("Taggers", "You Have Not Any Tagger"),
translate("Taggers", "Not found any tagger in your system. "
"Please install a tagger module. "
"Now supporting only eyeD3 module (python-eyed3)."))
return None
except:
ReportBug.ReportBug()
示例2: hash
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def hash(self):
sourceFile = str(self.lePathOfPackage.text())
sourceFile = fu.checkSource(sourceFile, "file")
if sourceFile is not None:
hashType = str(self.cbHash.currentText())
if hashType is not None:
hashDigestContent = fu.getHashDigest(sourceFile, hashType)
if hashDigestContent is not False:
self.teHashDigest.setText(str(hashDigestContent))
if self.cbHashOutput.currentIndex() == 1:
if fu.createHashDigestFile(sourceFile, str(self.leHashDigestFile.text()), hashType, False,
hashDigestContent):
Dialogs.show(translate("Hasher", "Hash Digest File Created"),
str(translate("Hasher", "Hash digest writed into %s")) % str(
self.leHashDigestFile.text()))
else:
Dialogs.showError(translate("Hasher", "Hash Digest File Is Not Created"),
translate("Hasher", "Hash digest file not cteated."))
elif self.cbHashOutput.currentIndex() == 2:
MApplication.clipboard().setText(str(hashDigestContent))
Dialogs.show(translate("Hasher", "Hash Digest Copied To Clipboard"),
str(translate("Hasher",
"Hash digest copied to clipboard.Hash digest is : <br>%s")) % hashDigestContent)
else:
Dialogs.showError(translate("Hasher", "Hash Digest Is Not Created"),
translate("Hasher", "Hash digest not cteated."))
示例3: readMusicFile
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def readMusicFile(_filePath, _isAlertWhenNotAvailable=True):
_directoryPath = fu.getDirName(_filePath)
isCanNoncompatible = False
if fu.isReadableFileOrDir(_filePath):
tagger = Taggers.getTagger()
try:
tagger.loadFile(_filePath)
except:
Dialogs.showError(translate("FileUtils/Musics", "Incorrect Tag"),
str(translate("FileUtils/Musics",
"\"%s\" : this file has the incorrect tag so can't read tags.")
) % Organizer.getLink(_filePath))
if tagger.isAvailableFile() is False:
isCanNoncompatible = True
content = {}
content["path"] = _filePath
content["baseNameOfDirectory"] = fu.getBaseName(_directoryPath)
content["baseName"] = fu.getBaseName(_filePath)
content["artist"] = tagger.getArtist()
content["title"] = tagger.getTitle()
content["album"] = tagger.getAlbum()
content["albumArtist"] = tagger.getAlbumArtist()
content["trackNum"] = tagger.getTrackNum()
content["year"] = tagger.getYear()
content["genre"] = tagger.getGenre()
content["firstComment"] = tagger.getFirstComment()
content["firstLyrics"] = tagger.getFirstLyrics()
content["images"] = tagger.getImages()
if isCanNoncompatible and _isAlertWhenNotAvailable:
Dialogs.show(translate("FileUtils/Musics", "Possible ID3 Mismatch"),
translate("FileUtils/Musics",
"Some of the files presented in the table may not support ID3 technology.<br>Please check the files and make sure they support ID3 information before proceeding."))
return content
示例4: uninstallPlugin
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def uninstallPlugin(self, _pluginName, _isQuiet=False):
isUninstalled = False
pluginModule = __import__("MyPlugins." + _pluginName, globals(), locals(),
["pluginName", "pluginFiles", "pluginDirectory", "uninstallThisPlugin",
"setupDirectory", "pluginVersion"], 0)
if pluginModule.uninstallThisPlugin is None:
if pluginModule.pluginDirectory == "":
for pluginFile in pluginModule.pluginFiles:
if fu.isFile(fu.joinPath(pluginModule.setupDirectory, pluginFile)):
fu.removeFileOrDir(fu.joinPath(pluginModule.setupDirectory, pluginFile))
isUninstalled = True
else:
if fu.isDir(fu.joinPath(pluginModule.setupDirectory, pluginModule.pluginDirectory)):
fu.removeFileOrDir(fu.joinPath(pluginModule.setupDirectory, pluginModule.pluginDirectory))
isUninstalled = True
else:
isUninstalled = pluginModule.uninstallThisPlugin()
if isUninstalled:
Settings.setUniversalSetting(str(pluginModule.pluginName), str(""))
if _isQuiet is False:
Dialogs.show(translate("MyPlugins", "Plug-in Uninstallation Is Complete"),
str(translate("MyPlugins", "\"%s\" is uninstalled on your system.")) % (
pluginModule.pluginName))
elif isUninstalled == "AlreadyUninstalled":
if _isQuiet is False:
Dialogs.show(translate("MyPlugins", "Plug-in Already Uninstalled"),
str(translate("MyPlugins", "\"%s\" already uninstalled on your system.")) % (
pluginModule.pluginName))
else:
if _isQuiet is False:
Dialogs.showError(translate("MyPlugins", "Plug-in Uninstallation Failed"),
str(translate("MyPlugins", "\"%s\" failed to uninstall on your system.")) % (
pluginModule.pluginName))
示例5: emendDirectoryWithContents
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def emendDirectoryWithContents(self):
try:
_path = self.checkSource(str(QuickMakeParameters[1]), "directory")
if _path is not None:
if uni.getBoolValue("isShowQuickMakeWindow"):
newEmendedName = str(self.leNewValue.text())
else:
newEmendedName = Organizer.emend(_path, fu.getObjectType(_path))
fu.activateSmartCheckIcon()
oldFileName = _path
newDirName = fu.moveOrChange(oldFileName, newEmendedName, "directory")
if newDirName != oldFileName:
fileAndDirectoryNames = fu.readDirectory(newDirName, "fileAndDirectory")
for fileAndDirs in fileAndDirectoryNames:
objectType = fu.getObjectType(fu.joinPath(newDirName, fileAndDirs))
fu.moveOrChange(fu.joinPath(newDirName, fileAndDirs),
fu.joinPath(newDirName, Organizer.emend(fileAndDirs, objectType)), objectType)
if uni.isActiveDirectoryCover and uni.getBoolValue(
"isActiveAutoMakeIconToDirectory") and uni.getBoolValue(
"isAutoMakeIconToDirectoryWhenFileMove"):
fu.checkIcon(newDirName)
if fu.isDir(newDirName):
fu.completeSmartCheckIcon()
Dialogs.show(translate("QuickMake", "Directory And Contents Emended"),
str(translate("QuickMake",
"\"%s\" is emended based on the criteria you set.This directory is \"%s\" now.")) %
(Organizer.getLink(_path), Organizer.getLink(newDirName)))
self.close()
except:
ReportBug.ReportBug()
示例6: search
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def search(self, _searchValue=""):
try:
import re
if self.setSourceToSearch(False):
if self.cckbIsRegExp.checkState() == Mt.Checked:
searchValueList = [str(self.leSearch.text())]
else:
searchValueList = self.getSearchValueList()
if len(searchValueList) != 0:
searchValueListForToolTip = ""
resultOfSearch = ""
arrayOfSource = str(self.sourceToSearch).split("\n\r")
if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("\n")
if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br>")
if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br/>")
if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br >")
if len(arrayOfSource) == 1: arrayOfSource = str(self.sourceToSearch).split("<br />")
for row in arrayOfSource:
for searchVal in searchValueList:
if self.cckbIsRegExp.checkState() == Mt.Checked:
try:
if self.cckbIsCaseInsensitive.checkState() == Mt.Checked:
pattern = re.compile(uni.trUnicode(searchVal), re.I | re.U)
if re.search(pattern, uni.trUnicode(row)) is not None:
resultOfSearch += row + "\n"
break
else:
pattern = re.compile(uni.trUnicode(searchVal), re.U)
if re.search(pattern, uni.trUnicode(row)) is not None:
resultOfSearch += row + "\n"
break
except:
Dialogs.show(translate("Searcher", "Incorrect Syntax"), translate("Searcher",
"Search value is not correct for Regular Expression (RegExp). Please check it and try again."))
return False
else:
if row.find(searchVal) != -1:
resultOfSearch += row + "\n"
break
if self.cckbIsCaseInsensitive.checkState() == Mt.Checked:
pattern = re.compile(re.escape(uni.trUnicode(searchVal)), re.I | re.U)
if re.search(pattern, uni.trUnicode(row)) is not None:
resultOfSearch += row + "\n"
break
else:
pattern = re.compile(re.escape(uni.trUnicode(searchVal)), re.U)
if re.search(pattern, uni.trUnicode(row)) is not None:
resultOfSearch += row + "\n"
break
for searchVal in searchValueList:
searchValueListForToolTip += "'" + searchVal + "', "
self.lblSearchListValues.setText(str(searchValueListForToolTip[0:-2]))
else:
resultOfSearch = str(self.sourceToSearch)
self.lblSearchListValues.setText(str(""))
self.teSearchResult.setText(str(resultOfSearch))
except:
ReportBug.ReportBug()
示例7: whatDoesSpecialCommandDo
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def whatDoesSpecialCommandDo(_actionCommand, _isShowAlert=False, _isReturnDetails=False):
splitterIndex = _actionCommand.index("~||~")
leftKeys = _actionCommand[:splitterIndex]
rightKeys = _actionCommand[splitterIndex + 1:]
if len(leftKeys) > 0 and len(rightKeys) > 0:
details = ""
leftNames = ""
rightNames = ""
for objectNameAndPoint in leftKeys:
objectNameAndPointList = objectNameAndPoint.split("~|~")
objectName = objectNameAndPointList[0]
point = ""
if len(objectNameAndPointList) > 1:
point = objectNameAndPointList[1]
if objectName.find("Concatenate") == -1:
leftNames += getMainTable().getColumnNameFromKey(objectName)
else:
leftNames += translate("Organizer", "Concatenate")
if point != "":
if objectName.find("Concatenate") == -1:
leftNames += " " + (str(translate("Organizer", "(can be separated by \"%s\")")) % (point))
else:
leftNames += " " + (str(translate("Organizer", "(can be concatenated by \"%s\")")) % (point))
if leftKeys[-1] != objectNameAndPoint:
leftNames += " ,"
for objectNameAndPoint in rightKeys:
objectNameAndPointList = objectNameAndPoint.split("~|~")
objectName = objectNameAndPointList[0]
point = ""
if len(objectNameAndPointList) > 1:
point = objectNameAndPointList[1]
if objectName.find("Concatenate") == -1:
rightNames += getMainTable().getColumnNameFromKey(objectName)
else:
rightNames += translate("Organizer", "Concatenate")
if point != "":
if objectName.find("Concatenate") == -1:
rightNames += " " + (str(translate("Organizer", "(can be separated by \"%s\")")) % (point))
else:
rightNames += " " + (str(translate("Organizer", "(can be concatenated by \"%s\")")) % (point))
if rightKeys[-1] != objectNameAndPoint:
rightNames += " ,"
details = str(translate("Organizer",
"\"%s\" will be concatenated and/or separated then it will be set as \"%s\" respectively.")) % (
leftNames, rightNames)
if _isShowAlert:
Dialogs.show(translate("Organizer", "What Does This Command Do?"), str(details))
if _isReturnDetails is False:
return True
else:
return details
else:
Dialogs.showError(translate("Organizer", "Missing Command"),
translate("Organizer", "You have to add at least a \"Column\"!.."))
return False
示例8: copyPath
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def copyPath(self):
try:
_path = self.checkSource(str(QuickMakeParameters[1]), "fileAndDirectory", False)
if _path is not None:
MApplication.clipboard().setText(str(_path))
Dialogs.show(translate("QuickMake", "Copied To Clipboard"),
str(translate("QuickMake", "\"%s\" copied to clipboard.")) % Organizer.getLink(_path))
self.close()
except:
ReportBug.ReportBug()
示例9: generateReadOnlyEmbeddedD
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def generateReadOnlyEmbeddedD(_isNoAlertIfSuccessfully=True):
stopReadOnlyEmbeddedDB()
if fu.isExist(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok"):
fu.removeFileOrDir(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
fu.copyFileOrDir(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/amarok",
fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
if _isNoAlertIfSuccessfully is False:
Dialogs.show(translate("EmbeddedDBCore", "Generated Embedded Server"),
translate("EmbeddedDBCore", "Embedded Amarok database server generated."))
return True
示例10: clearIgnoreds
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def clearIgnoreds(self):
try:
_path = self.checkSource(str(QuickMakeParameters[1]), "directory")
if _path is not None:
fu.clearIgnoreds(_path)
Dialogs.show(translate("QuickMake", "Directory Cleaned"),
str(translate("QuickMake",
"\"%s\" is cleaned based on the criteria you set.")) % Organizer.getLink(
_path))
self.close()
except:
ReportBug.ReportBug()
示例11: configureEmbeddedDB
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def configureEmbeddedDB(_isNoAlertIfSuccessfully=True):
stopEmbeddedDB()
backupEmbeddedDB()
fu.copyDirContent(fu.HamsiManagerDirectory + "/Amarok/EmbeddedDBFiles/mysql",
uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/mysql")
fu.copyFileOrDir(fu.HamsiManagerDirectory + "/Amarok/EmbeddedDBFiles/my.cnf",
uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/my.cnf")
MyConfigure.reConfigureFile(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/my.cnf")
if _isNoAlertIfSuccessfully is False:
Dialogs.show(translate("EmbeddedDBCore", "Created Embedded Server"),
translate("EmbeddedDBCore", "Embedded Amarok database server created and generated."))
return True
示例12: checkIcon
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def checkIcon(self):
try:
_path = self.checkSource(str(QuickMakeParameters[1]), "directory")
if _path is not None:
fu.checkIcon(_path)
Dialogs.show(translate("QuickMake", "Directory Icon Checked"),
str(translate("QuickMake",
"\"%s\"`s icon checked.<br>The default action based on the data is executed.")) % Organizer.getLink(
_path))
self.close()
except:
ReportBug.ReportBug()
示例13: restore
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def restore(self):
answer = Dialogs.ask(translate("Amarok", "Restore Amarok Database"),
translate("Amarok", "Are you want to restore backup database?"))
if answer == Dialogs.Yes:
if isRunning():
self.stopEmbeddedDB(True)
Dialogs.show(translate("EmbeddedDBConfigurator", "Close Amarok"),
translate("EmbeddedDBConfigurator", "Please close Amarok if it is running."))
restoreEmbeddedDB()
Dialogs.show(translate("EmbeddedDBConfigurator", "Restore Completed"), translate("EmbeddedDBConfigurator",
"Restore successfully completed.<br> You can run Amarok now if you want."))
self.checkRunState()
示例14: stopReadOnlyEmbeddedDB
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def stopReadOnlyEmbeddedDB(_isNoAlertIfSuccessfully=True):
global isReadOnlyStarted
if isReadOnlyStarted is False:
return True
isReadOnlyStarted = False
mysqldPID = getReadOnlyPID()
if mysqldPID is not None:
Execute.execute(["kill", "-TERM", str(mysqldPID)])
Dialogs.sleep(translate("EmbeddedDBCore", "Stopping Embedded Server..."), 3)
if _isNoAlertIfSuccessfully is False:
Dialogs.show(translate("EmbeddedDBCore", "Stopped Embedded Server"),
translate("EmbeddedDBCore", "Embedded Amarok database server stopped."))
return True
示例15: isReadOnlyRunning
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import show [as 别名]
def isReadOnlyRunning(self):
try:
if isReadOnlyRunning():
self.pbtnStopEmbeddedDB.setEnabled(True)
self.pbtnStartEmbeddedDB.setEnabled(False)
Dialogs.show(translate("EmbeddedDBConfigurator", "Running Embedded Server"),
translate("EmbeddedDBConfigurator", "Embedded Amarok database server is running."))
else:
self.pbtnStopEmbeddedDB.setEnabled(False)
self.pbtnStartEmbeddedDB.setEnabled(True)
Dialogs.show(translate("EmbeddedDBConfigurator", "Not Running Embedded Server"),
translate("EmbeddedDBConfigurator", "Embedded Amarok database server is not running."))
except:
ReportBug.ReportBug()