当前位置: 首页>>代码示例>>Python>>正文


Python Installer.install方法代码示例

本文整理汇总了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)
开发者ID:frapposelli,项目名称:photon,代码行数:34,代码来源:imagebuilder.py

示例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()
开发者ID:idiles,项目名称:opendict,代码行数:23,代码来源:dictaddwin.py

示例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
开发者ID:brada1,项目名称:bmm,代码行数:39,代码来源:bmm0.2.py

示例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)
开发者ID:softtrainee,项目名称:arlab,代码行数:26,代码来源:app_bundler.py

示例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")
开发者ID:brada1,项目名称:bmm,代码行数:38,代码来源:bmm_wxGUI.py

示例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)
开发者ID:frapposelli,项目名称:photon,代码行数:8,代码来源:installercontainer.py

示例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']:
开发者ID:megacoder,项目名称:photon,代码行数:33,代码来源:photonInstaller.py


注:本文中的installer.Installer.install方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。