本文整理汇总了Python中installer.Installer.uninstall方法的典型用法代码示例。如果您正苦于以下问题:Python Installer.uninstall方法的具体用法?Python Installer.uninstall怎么用?Python Installer.uninstall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类installer.Installer
的用法示例。
在下文中一共展示了Installer.uninstall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import uninstall [as 别名]
def main():
instr = ''
while instr != 'exit':
db = Database.build()
instr = input("\ntype mod ID (e.g. '3') or 'exit'\n")
try:
if instr != 'exit':
inp = int(instr)
dbq = db[inp]
print ("choose instruction (e.g. '1')")
if 'installed' in dbq:
inp2 = int(input("'0' - uninstall\n'1' - cancel\n"))
if inp2 == 0:
Installer.uninstall(dbq)
elif inp2 == 1:
pass
elif 'downloaded' in dbq:
inp2 = int(input("'0' - install\n'1' - remove\n'2' - cancel\n"))
if inp2 == 0:
Installer.install(dbq)
elif inp2 == 1:
Downloader.rm(dbq)
elif inp2 == 2:
pass
else:
inp2 = int(input("'0' - download\n'1' - cancel\n"))
if inp2 == 0:
Downloader.dl(dbq)
elif inp2 == 1:
pass
elif instr == 'exit':
print ('exiting...')
break
except ValueError:
print ('valid ID please')
continue
示例2: OnApply
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import uninstall [as 别名]
def OnApply(self, event):
self.log.AppendText("please wait...\n")
for i in range(len(db[0])):
if self.list.IsChecked(i):
if len(db[0][i]) == 6:
pass
else:
if len(db[0][i]) == 5:
pass
else:
self.log.AppendText("downloading " + str(db[0][i]) + "...\n")
try:
Downloader.dl(db[0][i])
except:
self.log.AppendText("failed\n")
self.log.AppendText("installing " + str(db[0][i]) + "...\n")
try:
Installer.install(db[0][i])
except:
self.log.AppendText("failed\n")
else:
if len(db[0][i]) == 6:
self.log.AppendText("uninstalling " + str(db[0][i]) + "...\n")
try:
Installer.uninstall(db[0][i])
except:
self.log.AppendText("failed\n")
self.log.AppendText("refreshing database...\n")
global db
db = Database.build()
self.log.AppendText("all done\n")