本文整理匯總了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")