本文整理汇总了Python中installer.Installer.install方法的典型用法代码示例。如果您正苦于以下问题:Python Installer.install方法的具体用法?Python Installer.install怎么用?Python Installer.install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类installer.Installer
的用法示例。
在下文中一共展示了Installer.install方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runInstaller
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [as 别名]
def runInstaller(options, config):
try:
sys.path.insert(0, options.installer_path)
from installer import Installer
from packageselector import PackageSelector
except:
raise ImportError('Installer path incorrect!')
config["pkg_to_rpm_map_file"] = options.pkg_to_rpm_map_file
# Check the installation type
option_list_json = Utils.jsonread(options.package_list_file)
options_sorted = option_list_json.items()
packages = []
if 'type' in config:
for install_option in options_sorted:
if install_option[0] == config['type']:
packages = PackageSelector.get_packages_to_install(install_option[1]['packagelist_file'],
options.generated_data_path)
break
else:
if 'packagelist_file' in config:
packages = PackageSelector.get_packages_to_install(config['packagelist_file'],
options.generated_data_path)
if 'additional_packages' in config:
packages = packages.extend(config['additional_packages'])
config['packages'] = packages
# Run the installer
package_installer = Installer(config, rpm_path=options.rpm_path,
log_path=options.log_path, log_level=options.log_level)
return package_installer.install(None)
示例2: onOK
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [as 别名]
def onOK(self, event):
parent = self.GetParent()
i = self.box.GetSelection()
ext = ""
if i == 0:
ext = "zip"
elif i == 1:
ext = "dwa"
elif i == 2:
ext = "mova"
elif i == 3:
ext = "tmx"
elif i == 4:
ext == "dz"
from installer import Installer
installer = Installer(parent, parent.app.config)
installer.install(self.filePath, ext)
self.Destroy()
示例3: main
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [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
示例4: cli_install
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [as 别名]
def cli_install():
parser = argparse.ArgumentParser(description='Create a new Launchable Application')
parser.add_argument('prefix',
# metavar = 'prefix',
type=str, nargs='?',
help='Prefix name. used to identify the icon file and the launch script eg. pychron'
)
parser.add_argument('name',
# metavar = 'name',
type=str, nargs='?',
help='Name of the application bundle eg. Pychron')
parser.add_argument('--icon', type=str, nargs='?',
help='icon file name')
args = parser.parse_args()
i = Installer(args.prefix, args.name, args.icon)
root = os.path.join(os.path.expanduser('~'),
'Programming', 'mercurial',
'pychron_beta'
)
i.install(root)
示例5: OnApply
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [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")
示例6: install
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [as 别名]
def install(self, params):
installer = None
installer = Installer(self.install_config, self.maxy, self.maxx,
self.iso_installer, self.rpm_path, self.log_path, self.log_level)
return installer.install(params)
示例7: Installer
# 需要导入模块: from installer import Installer [as 别名]
# 或者: from installer.Installer import install [as 别名]
packages = PackageSelector.get_packages_to_install(options_sorted, config['type'], options.output_data_path)
config['packages'] = packages
if (os.path.isdir(options.working_directory)):
process = subprocess.Popen(['rm', '-rf', options.working_directory])
retval = process.wait()
process = subprocess.Popen(['mkdir', '-p', os.path.join(options.working_directory, "photon-chroot")])
retval = process.wait()
config['working_directory'] = options.working_directory
# Run the installer
package_installer = Installer(config, rpm_path = options.rpm_path, log_path = options.log_path)
package_installer.install(None)
# Making the iso if needed
if options.iso_path:
rpm_list = " ".join(create_rpm_list_to_be_copied_to_iso(options.pkg_to_rpm_map_file, options.pkg_to_be_copied_conf_file, 1, options.output_data_path))
files_to_copy = " ".join(create_additional_file_list_to_copy_in_iso(os.path.abspath(options.stage_path), options.package_list_file))
live_cd = get_live_cd_status_string(options.package_list_file)
process = subprocess.Popen(['./mk-install-iso.sh', '-w', options.working_directory, options.iso_path, options.rpm_path, options.package_list_file, rpm_list, options.stage_path, files_to_copy, live_cd, options.json_data_path])
retval = process.wait()
if options.debug_iso_path:
debug_rpm_list = create_rpm_list_to_be_copied_to_iso(options.pkg_to_rpm_map_file, options.pkg_to_be_copied_conf_file, 2, options.output_data_path)
make_debug_iso(options.working_directory, options.debug_iso_path, debug_rpm_list)
# Cleaning up for vmdk
if 'vmdk_install' in config and config['vmdk_install']: