本文整理汇总了Python中FileUtils.checkNewDestination方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtils.checkNewDestination方法的具体用法?Python FileUtils.checkNewDestination怎么用?Python FileUtils.checkNewDestination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils.checkNewDestination方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finish
# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import checkNewDestination [as 别名]
def finish(self):
try:
if fu.isFile(fu.joinPath(self.installationDirectory, "HamsiManager.desktop")):
MyConfigure.reConfigureFile(fu.joinPath(self.installationDirectory, "HamsiManager.desktop"),
self.installationDirectory)
if self.isCreateDesktopShortcut is not None:
if self.isCreateDesktopShortcut.checkState() == Mt.Checked:
desktopPath = uni.getUserDesktopPath()
if uni.isWindows:
MyConfigure.createShortCutFile(fu.joinPath(desktopPath, "Hamsi Manager.lnk"),
self.installationDirectory)
else:
fileContent = MyConfigure.getConfiguredDesktopFileContent(self.installationDirectory)
fu.writeToFile(fu.joinPath(desktopPath, "HamsiManager.desktop"), fileContent)
if self.isCreateExecutableLink is not None:
executableLink = str(self.leExecutableLink.text())
if self.isCreateExecutableLink.checkState() == Mt.Checked:
if executableLink.strip() != "":
executableLink = fu.checkNewDestination(executableLink)
if executableLink:
HamsiManagerFileName = Execute.findExecutableBaseName("HamsiManager")
fu.createSymLink(fu.joinPath(self.installationDirectory, HamsiManagerFileName),
executableLink)
Settings.setUniversalSetting("HamsiManagerExecutableLinkPath", executableLink)
if fu.isDir("/usr/share/applications/"):
fileContent = MyConfigure.getConfiguredDesktopFileContent(self.installationDirectory)
fu.writeToFile("/usr/share/applications/HamsiManager.desktop", fileContent)
if uni.isRunningAsRoot() is False:
if fu.isDir(fu.joinPath(fu.userDirectoryPath, ".local", "applications")) is False:
fu.makeDirs(fu.joinPath(fu.userDirectoryPath, ".local", "applications"))
fileContent = MyConfigure.getConfiguredDesktopFileContent(self.installationDirectory)
fu.writeToFile(fu.joinPath(fu.userDirectoryPath, ".local", "applications", "HamsiManager.desktop"),
fileContent)
self.isInstallFinished = True
self.close()
except:
from Core import ReportBug
ReportBug.ReportBug()