本文整理汇总了Python中resources.lib.FileAccess.FileAccess.delete方法的典型用法代码示例。如果您正苦于以下问题:Python FileAccess.delete方法的具体用法?Python FileAccess.delete怎么用?Python FileAccess.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resources.lib.FileAccess.FileAccess
的用法示例。
在下文中一共展示了FileAccess.delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DeleteSettings2
# 需要导入模块: from resources.lib.FileAccess import FileAccess [as 别名]
# 或者: from resources.lib.FileAccess.FileAccess import delete [as 别名]
def DeleteSettings2():
log('utilities: DeleteSettings2')
ClearChanFavorites(False)
if FileAccess.exists(SETTINGS_FLE):
if yesnoDialog("Delete Current Channel Configurations?"):
try:
REAL_SETTINGS.setSetting("Config","")
REAL_SETTINGS.setSetting("CurrentChannel","1")
FileAccess.delete(SETTINGS_FLE)
infoDialog("Channel Configurations Cleared")
except:
pass
# Return to PTVL Settings
REAL_SETTINGS.openSettings()
示例2: downloadSkin
# 需要导入模块: from resources.lib.FileAccess import FileAccess [as 别名]
# 或者: from resources.lib.FileAccess.FileAccess import delete [as 别名]
def downloadSkin(self, selSkin):
self.log("downloadSkin")
url = self.SkinPanel.getSelectedItem().getProperty('PTVL.SKINZIP')
dl = os.path.join(PTVL_SKIN_LOC,'%s.zip'%selSkin)
try:
print url, dl
download(url, dl, '')
all(dl, os.path.join(PTVL_SKIN_LOC,''),True)
try:
FileAccess.delete(dl)
except:
pass
return True
except:
return False
示例3: makeXMLTV
# 需要导入模块: from resources.lib.FileAccess import FileAccess [as 别名]
# 或者: from resources.lib.FileAccess.FileAccess import delete [as 别名]
def makeXMLTV(self, data, filepath):
self.log('makeXMLTV')
finished = False
if not FileAccess.exists(os.path.dirname(filepath)):
FileAccess.mkdir(os.path.dirname(filepath))
if FileAccess.exists(filepath):
FileAccess.delete(filepath)
fle = open(filepath, "w")
try:
xml = data.toxml(encoding='UTF-8');
log('writing item: %s' % (filepath))
if FileAccess.exists(filepath):
finished = True
except Exception as e:
xml = '<?xml version="1.0" encoding="UTF-8"?>'
xml += '<error>' + str(e) + '</error>';
xmllst = xml.replace('><','>\n<')
xmllst = self.cleanChanName(xmllst)
fle.write("%s" % xmllst)
fle.close()
return finished