本文整理汇总了Python中installer.Installer类的典型用法代码示例。如果您正苦于以下问题:Python Installer类的具体用法?Python Installer怎么用?Python Installer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Installer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runInstaller
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: __init__
def __init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration):
Installer.__init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration)
self.specificationFileName = os.path.join(self.tempDir, 'product_specification')
self.configurePath = os.path.join(self.tempDir, "configure.sh")
self.unconfigurePath = os.path.join(self.tempDir, "unconfigure.sh")
self.preinstallPath = os.path.join(self.tempDir, "preinstall.sh")
self.postremovePath = os.path.join(self.tempDir, "postremove.sh")
示例3: __init__
def __init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration):
Installer.__init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration)
self.scriptDir = os.path.join(self.tempDir, "scripts")
self.preinstallPath = os.path.join(self.scriptDir, "preinstall")
self.postinstallPath = os.path.join(self.scriptDir, "postinstall")
self.preupgradePath = os.path.join(self.scriptDir, "preupgrade")
self.postupgradePath = os.path.join(self.scriptDir, "postupgrade")
self.osverstring = str(self.configuration["pfmajor"]) + "." + self.configuration["pfminor_str"]
if self.configuration["pfmajor"] == 10:
if self.configuration["pfminor"] == 4:
self.packageHelper = MacOS10_4PackageHelper(
self.stagingRootDir,
self.tempDir,
self.configuration["version"],
self.configuration["release"],
self.scriptDir,
)
elif self.configuration["pfminor"] == 5:
self.packageHelper = MacOS10_5PackageHelper(
self.stagingRootDir,
self.tempDir,
self.targetDir,
self.configuration["version"],
self.configuration["release"],
self.preinstallPath,
self.postinstallPath,
self.preupgradePath,
self.postupgradePath,
)
else:
raise scxexceptions.PlatformNotImplementedError(self.osverstring)
else:
raise scxexceptions.PlatformNotImplementedError(self.osverstring)
示例4: __init__
def __init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration):
Installer.__init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration)
self.controlDir = os.path.join(self.stagingRootDir, 'DEBIAN')
self.controlFileName = os.path.join(self.controlDir, 'control')
self.configFileName = os.path.join(self.controlDir, 'conffiles')
self.preInstallPath = os.path.join(self.controlDir, 'preinst')
self.postInstallPath = os.path.join(self.controlDir, 'postinst')
self.preUninstallPath = os.path.join(self.controlDir, 'prerm')
self.postUninstallPath = os.path.join(self.controlDir, 'postrm')
示例5: __init__
def __init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration):
Installer.__init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration)
self.prototypeFileName = os.path.join(self.tempDir, "prototype")
self.pkginfoFile = PKGInfoFile(self.tempDir, self.configuration)
self.depFileName = os.path.join(self.tempDir, "depend")
self.preInstallPath = os.path.join(self.tempDir, "preinstall.sh")
self.postInstallPath = os.path.join(self.tempDir, "postinstall.sh")
self.preUninstallPath = os.path.join(self.tempDir, "preuninstall.sh")
self.postUninstallPath = os.path.join(self.tempDir, "postuninstall.sh")
self.iConfigFileName = os.path.join(self.tempDir, "i.config")
self.rConfigFileName = os.path.join(self.tempDir, "r.config")
示例6: finalize_system
def finalize_system(self):
Installer.finalize_system(self)
self.run("mkdir -p {}/srv/rpm-ostree/repo".format(self.photon_root))
self.run("cp ./photon-base.json {}/srv/rpm-ostree/".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon.repo {}/srv/rpm-ostree/photon-ostree.repo".format(self.photon_root))
self.run("cp ./ostree-httpd.conf {}/srv/rpm-ostree/".format(self.photon_root))
self.run("cp ./httpd.service {}/usr/lib/systemd/system/".format(self.photon_root))
self.run("cp ./get-ip-address.sh {}/usr/bin/".format(self.photon_root))
self.run("cp ./ostree-server-greeting.txt {}/etc/issue".format(self.photon_root))
self.run("ln -s /usr/lib/systemd/system/httpd.service {}/usr/lib/systemd/system/multi-user.target.wants/httpd.service".format(self.photon_root))
self.run("tar -xf /mnt/cdrom/ostree-repo.tar.gz -C {}/srv/rpm-ostree/repo".format(self.photon_root))
开发者ID:Virtualization-Appliance-Marketplace,项目名称:VAM-VMware-Photon,代码行数:12,代码来源:ostreeserverinstaller.py
示例7: __init__
def __init__(self, buildout, name, options):
self.log = logging.getLogger(name)
self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options)
self.buildout, self.name, self.options = buildout, name, options
options['location'] = os.path.join(
buildout['buildout']['parts-directory'], name)
options['bin-directory'] = buildout['buildout']['bin-directory']
options.setdefault('project', 'example.com')
options.setdefault('external-apps', 'apps')
options.setdefault('local-apps', 'company')
options.setdefault('settings', 'development')
options.setdefault('urlconf', options['project'] + '.urls')
# Set this so the rest of the recipe can expect the values to be
# there. We need to make sure that both pythonpath and extra-paths are
# set for BBB.
if 'extra-paths' in options:
options['pythonpath'] = options['extra-paths']
else:
options.setdefault('extra-paths', options.get('pythonpath', ''))
# Usefull when using archived versions
buildout['buildout'].setdefault(
'download-cache',
os.path.join(buildout['buildout']['directory'],
'downloads'))
# only try to download stuff if we aren't asked to install from cache
self.install_from_cache = self.buildout['buildout'].get(
'install-from-cache', '').strip() == 'true'
self.__installer = Installer(self.options, self.buildout, self.log, self.name)
示例8: __init__
def __init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration):
Installer.__init__(self, srcDir, targetDir, installerDir, intermediateDir, configuration)
self.filesetName = self.configuration['short_name'] + '.rte'
self.lppNameFileName = os.path.join(self.stagingRootDir, 'lpp_name')
self.alFileName = os.path.join(self.tempDir, self.filesetName + '.al')
self.cfgfilesFileName = os.path.join(self.tempDir, self.filesetName + '.cfgfiles')
self.copyrightFileName = os.path.join(self.tempDir, self.filesetName + '.copyright')
self.inventoryFileName = os.path.join(self.tempDir, self.filesetName + '.inventory')
self.sizeFileName = os.path.join(self.tempDir, self.filesetName + '.size')
self.productidFileName = os.path.join(self.tempDir, 'productid')
self.liblppFileName = os.path.join(self.stagingRootDir, 'usr/lpp/' + self.filesetName +'/liblpp.a')
# Need to specify new file names for scripts.
self.preInstallPath = os.path.join(self.tempDir, self.filesetName + '.pre_i')
self.postInstallPath = os.path.join(self.tempDir, self.filesetName + '.config')
self.preUninstallPath = os.path.join(self.tempDir, self.filesetName + '.unconfig')
self.preUpgradePath = os.path.join(self.tempDir, self.filesetName + '.pre_rm')
示例9: __init__
def __init__(self, buildout, name, options):
self.log = logging.getLogger(name)
self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options)
self.buildout, self.name, self.options = buildout, name, options
options['location'] = os.path.join(
buildout['buildout']['parts-directory'], name)
options['bin-directory'] = buildout['buildout']['bin-directory']
options.setdefault('project', 'example.com')
options.setdefault('external-apps', 'apps')
options.setdefault('local-apps', 'company')
options.setdefault('settings', 'development')
options.setdefault('libs-path', 'lib')
options.setdefault('script-dir', 'bin')
options.setdefault('turboengine', '')
options.setdefault('webservices', 'false')
options.setdefault('zipped', 'false')
# Usefull when using archived versions
buildout['buildout'].setdefault(
'download-cache',
os.path.join(buildout['buildout']['directory'],
'downloads'))
self.__installer = Installer(self.options, self.buildout, self.log, self.name)
示例10: IDABuddy
class IDABuddy(idaapi.plugin_t):
flags = 0
comment = 'IDABuddy'
help = 'IDABuddy'
wanted_name = 'IDABuddy'
wanted_hotkey = ''
def init(self):
self._installer = Installer()
self._installer.start()
return idaapi.PLUGIN_KEEP
def term(self):
self._installer.stop()
def run(self, arg):
pass
示例11: finalize_system
def finalize_system(self):
Installer.finalize_system(self)
self.run("mkdir -p {}/srv/rpm-ostree/repo".format(self.photon_root))
self.run("cp ./photon-base.json {}/srv/rpm-ostree/".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon.repo {}/srv/rpm-ostree/photon-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon-iso.repo {}/srv/rpm-ostree/photon-iso-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon-updates.repo {}/srv/rpm-ostree/photon-updates-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon-extras.repo {}/srv/rpm-ostree/photon-extras-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/lightwave.repo {}/srv/rpm-ostree/lightwave-ostree.repo".format(self.photon_root))
self.run("cp ./ostree-httpd.conf {}/srv/rpm-ostree/".format(self.photon_root))
self.run("cp ./httpd.service {}/usr/lib/systemd/system/".format(self.photon_root))
self.run("cp ./get-ip-address.sh {}/usr/bin/".format(self.photon_root))
self.run("cp ./ostree-server-greeting.txt {}/etc/issue".format(self.photon_root))
self.run("ln -s /usr/lib/systemd/system/httpd.service {}/usr/lib/systemd/system/multi-user.target.wants/httpd.service".format(self.photon_root))
self.run("tar -xf /mnt/cdrom/ostree-repo.tar.gz -C {}/srv/rpm-ostree/repo".format(self.photon_root))
self.run("sed -i \"\\$i iptables -A INPUT -m state --state NEW,ESTABLISHED -p tcp --dport 80 -j ACCEPT\" {}/etc/systemd/scripts/iptables".format(self.photon_root))
self.run("sed -i \"\\$i iptables -A INPUT -m state --state NEW,ESTABLISHED -p tcp --dport 443 -j ACCEPT\" {}/etc/systemd/scripts/iptables".format(self.photon_root))
示例12: GAEBuild
class GAEBuild(object):
def __init__(self, buildout, name, options):
self.log = logging.getLogger(name)
self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options)
self.buildout, self.name, self.options = buildout, name, options
options['location'] = os.path.join(
buildout['buildout']['parts-directory'], name)
options['bin-directory'] = buildout['buildout']['bin-directory']
options.setdefault('project', 'example.com')
options.setdefault('external-apps', 'apps')
options.setdefault('local-apps', 'company')
options.setdefault('settings', 'development')
options.setdefault('libs-path', 'lib')
options.setdefault('script-dir', 'bin')
options.setdefault('turboengine', '')
options.setdefault('webservices', 'false')
options.setdefault('zipped', 'false')
# Usefull when using archived versions
buildout['buildout'].setdefault(
'download-cache',
os.path.join(buildout['buildout']['directory'],
'downloads'))
self.__installer = Installer(self.options, self.buildout, self.log, self.name)
def install(self):
print '\n------------------ Installing GAEBuild ------------------\n'
location = self.options['location']
base_dir = self.buildout['buildout']['directory']
project_dir = os.path.join(base_dir, 'src')
download_dir = self.buildout['buildout']['download-cache']
extra_path = self.__installer.get_extra_paths()
requirements, ws = self.egg.working_set(['gaebuild'])
self.__installer.verify_or_create_download_dir(download_dir)
self.__installer.install_recipe(location)
self.__installer.install_project(project_dir, self.options['project'])
script_paths = self.__installer.install_scripts(project_dir, extra_path, ws)
print '\n------------------ Installing GAEBuild ------------------\n'
return script_paths + [location]
def update(self):
pass
示例13: onOK
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()
示例14: finalize_system
def finalize_system(self):
Installer.finalize_system(self)
self.run("mkdir -p {}/srv/rpm-ostree/repo".format(self.photon_root))
self.run("cp ./photon-base.json {}/srv/rpm-ostree/".format(self.photon_root))
self.run("cp ./photon-minimal.json {}/srv/rpm-ostree/".format(self.photon_root))
self.run("cp ./photon-full.json {}/srv/rpm-ostree/".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon.repo {}/srv/rpm-ostree/photon-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon-iso.repo {}/srv/rpm-ostree/photon-iso-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon-updates.repo {}/srv/rpm-ostree/photon-updates-ostree.repo".format(self.photon_root))
self.run("ln -s /etc/yum.repos.d/photon-extras.repo {}/srv/rpm-ostree/photon-extras-ostree.repo".format(self.photon_root))
self.run("cp ./ostree-httpd.conf {}/srv/rpm-ostree/".format(self.photon_root))
# Use a custom httpd service file for ostree server
self.run("mkdir {}/etc/systemd/system/httpd.service.d".format(self.photon_root))
self.run("cp ./10-httpd-service.conf {}/etc/systemd/system/httpd.service.d/".format(self.photon_root))
self.run("cp ./get-ip-address.sh {}/usr/bin/".format(self.photon_root))
self.run("cp ./ostree-server-greeting.txt {}/etc/issue".format(self.photon_root))
self.run("ln -s /usr/lib/systemd/system/httpd.service {}/usr/lib/systemd/system/multi-user.target.wants/httpd.service".format(self.photon_root))
self.run("tar -xf /mnt/cdrom/ostree-repo.tar.gz -C {}/srv/rpm-ostree/repo".format(self.photon_root))
self.run("sed -i \"\\$i iptables -A INPUT -m state --state NEW,ESTABLISHED -p tcp --dport 80 -j ACCEPT\" {}/etc/systemd/scripts/iptables".format(self.photon_root))
self.run("sed -i \"\\$i iptables -A INPUT -m state --state NEW,ESTABLISHED -p tcp --dport 443 -j ACCEPT\" {}/etc/systemd/scripts/iptables".format(self.photon_root))
self.run("sed -i \"s/umask[ \t]\+[0-9]\+/umask 022/g\" {}/etc/profile".format(self.photon_root))
示例15: main
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