當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。