• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python rhpl.getArch函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中rhpl.getArch函数的典型用法代码示例。如果您正苦于以下问题:Python getArch函数的具体用法?Python getArch怎么用?Python getArch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getArch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: toEntry

    def toEntry(self, partitions):
        """Turn a request into a fsset entry and return the entry."""
        device = self.getDevice(partitions)

        # pin down our partitions so that we can reread the table
        device.solidify()

        if self.fstype.getName() == "swap":
            mountpoint = "swap"
        else:
            mountpoint = self.mountpoint

        entry = fsset.FileSystemSetEntry(device, mountpoint, self.fstype,
                                         origfsystem=self.origfstype,
                                         bytesPerInode=self.bytesPerInode,
                                         options=self.fsopts)
        if self.format:
            entry.setFormat(self.format)

        if self.migrate:
            entry.setMigrate(self.migrate)
        elif rhpl.getArch() == "ia64" \
                and entry.getMountPoint() == "/boot/efi" \
                and isinstance(self.origfstype, fsset.FATFileSystem) \
                and not entry.getFormat():
            entry.setMigrate(1)

        if self.badblocks:
            entry.setBadblocks(self.badblocks)

        if self.fslabel:
            entry.setLabel(self.fslabel)

        return entry
开发者ID:abiquo-rpms,项目名称:anaconda-ee,代码行数:34,代码来源:partRequests.py


示例2: getScreen

    def getScreen (self, anaconda):
        hbox = gtk.HBox (False, 5)
        
        pix = gui.readImageFromFile ("done.png")
        if pix:
            a = gtk.Alignment ()
            a.add (pix)
            a.set (0.5, 0.5, 1.0, 1.0)
	    a.set_size_request(200, -1)
            hbox.pack_start (a, False, False, 36)

        bootstr = ""
        if rhpl.getArch() in ['s390', 's390x']:
            floppystr = ""
            if not anaconda.canReIPL:
                self.rebootButton.set_label(_("Shutdown"))
            if not anaconda.reIPLMessage is None:
                floppystr = anaconda.reIPLMessage

        else:
            floppystr = _("Remove any media used during the installation "
                          "process and press the \"Reboot\" button to "
                          "reboot your system."
                          "\n\n")

        txt = _("Congratulations, the installation is complete.\n\n"
                "%s%s") %(floppystr, bootstr)
	label = gui.WrappingLabel(txt)

        hbox.pack_start (label, True, True)

        gtk.gdk.beep()
        return hbox
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:33,代码来源:congrats_gui.py


示例3: isPaeAvailable

def isPaeAvailable():
    global isPAE
    if isPAE is not None:
        return isPAE

    isPAE = False
    if rhpl.getArch() not in ("i386", "x86_64"):
        return isPAE

    try:
        f = open("/proc/iomem", "r")
        lines = f.readlines()
        for line in lines:
            if line[0].isspace():
                continue
            start = line.split(' ')[0].split('-')[0]
            start = long(start, 16)

            if start >= 0x100000000L:
                isPAE = True
                break

        f.close()
    except:
        pass

    return isPAE
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:27,代码来源:isys.py


示例4: __call__

    def __call__(self, screen, anaconda):
        bootstr = ""
        buttonstr = _("Reboot")

        if rhpl.getArch() in ["s390", "s390x"]:
            floppystr = _("Press <Enter> to end the installation process.\n\n")
            bottomstr = _("<Enter> to exit")
            if not anaconda.canReIPL:
                buttonstr = _("Shutdown")
            if not anaconda.reIPLMessage is None:
                floppystr = anaconda.reIPLMessage + "\n\n" + floppystr
        else:
            floppystr = _(
                "Remove any media used during the installation "
                "process and press <Enter> to reboot your system."
                "\n\n"
            )
            bottomstr = _("<Enter> to reboot")

        screen.pushHelpLine(string.center(bottomstr, screen.width))

        txt = _("Congratulations, your %s installation is " "complete.\n\n" "%s%s") % (productName, floppystr, bootstr)
        foo = _(
            "For information on errata (updates and bug fixes), visit "
            "http://www.redhat.com/errata/.\n\n"
            "Information on using your "
            "system is available in the %s manuals at "
            "http://www.redhat.com/docs/."
        ) % (productName,)

        rc = ButtonChoiceWindow(screen, _("Complete"), txt, [buttonstr], help="finished", width=60)

        return INSTALL_OK
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:33,代码来源:complete_text.py


示例5: getPPCMacGen

def getPPCMacGen():
    # XXX: should NuBus be here?
    pmacGen = ["OldWorld", "NewWorld", "NuBus"]

    if rhpl.getArch() != "ppc":
        return 0
    if getPPCMachine() != "PMac":
        return 0

    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()
    gen = None
    for line in lines:
        if line.find("pmac-generation") != -1:
            gen = line.split(":")[1]
            break

    if gen is None:
        log.warning("Unable to find pmac-generation")

    for type in pmacGen:
        if gen.find(type) != -1:
            return type

    log.warning("Unknown Power Mac generation: %s" % (gen,))
    return 0
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:27,代码来源:iutil.py


示例6: upgradeMigrateFind

def upgradeMigrateFind(anaconda):
    migents = anaconda.id.fsset.getMigratableEntries()
    if not migents or len(migents) < 1 or \
            (rhpl.getArch() == "ia64" and len(migents) == 1 and \
             migents[0].getMountPoint() == "/boot/efi"):
        anaconda.dispatch.skipStep("upgrademigratefs")
    else:
        anaconda.dispatch.skipStep("upgrademigratefs", skip = 0)
开发者ID:abiquo,项目名称:anaconda-ee,代码行数:8,代码来源:upgrade.py


示例7: getScreen

    def getScreen (self, anaconda):
      
        self.fsset = anaconda.id.fsset
        self.migent = self.fsset.getMigratableEntries()
        
        box = gtk.VBox (False, 5)
        box.set_border_width (5)

	text = N_("This release of %s supports "
                 "the ext3 journalling file system.  It has several "
                 "benefits over the ext2 file system traditionally shipped "
                 "in %s.  It is possible to migrate the ext2 "
                 "formatted partitions to ext3 without data loss.\n\n"
                 "Which of these partitions would you like to migrate?" %
                  (productName, productName))
        
	label = gtk.Label (_(text))
        label.set_alignment (0.5, 0.0)
        label.set_size_request(400, -1)
        label.set_line_wrap (True)
        box.pack_start(label, False)

        cbox = gtk.VBox(False, 5)
        self.cbs = []
        for entry in self.migent:
            if rhpl.getArch() == "ia64" \
                    and entry.getMountPoint() == "/boot/efi":
                continue
            if entry.fsystem.getName() != entry.origfsystem.getName():
                migrating = 1
            else:
                migrating = 0
            
            cb = gtk.CheckButton("/dev/%s - %s - %s" % (entry.device.getDevice(),
                                              entry.origfsystem.getName(),
                                              entry.mountpoint))
            cb.set_active(migrating)
            cbox.pack_start(cb, False)

            self.cbs.append((cb, entry))

        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        sw.add_with_viewport(cbox)
        sw.set_size_request(-1, 175)
        
        viewport = sw.get_children()[0]
        viewport.set_shadow_type(gtk.SHADOW_IN)
        
        a = gtk.Alignment(0.25, 0.5)
        a.add(sw)

        box.pack_start(a, True)
        
        a = gtk.Alignment(0.5, 0.5)
        a.add(box)
        return a
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:57,代码来源:upgrade_migratefs_gui.py


示例8: readFATLabel

def readFATLabel(device, makeDevNode = 1):
    if not rhpl.getArch() == "ia64":
        return None
    if makeDevNode:
        makeDevInode(device, "/tmp/disk")
        label = _readFATLabel("/tmp/disk")
        os.unlink("/tmp/disk")
    else:
        label = _readFATLabel(device)
    return label
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:10,代码来源:isys.py


示例9: copyExceptionToFloppy

def copyExceptionToFloppy (anaconda):
    # in test mode have save to floppy option just copy to new name
    if not flags.setupFilesystems:
        try:
            shutil.copyfile("/tmp/anacdump.txt", "/tmp/test-anacdump.txt")
        except:
            log.error("Failed to copy anacdump.txt to /tmp/test-anacdump.txt")
            pass

        anaconda.intf.__del__ ()
        return 2

    while 1:
        # Bail if they hit the cancel button.
        rc = anaconda.intf.dumpWindow()
        if rc:
            return 1

        device = anaconda.id.floppyDevice
        file = "/tmp/floppy"
        try:
            isys.makeDevInode(device, file)
        except SystemError:
            pass
        
        try:
            fd = os.open(file, os.O_RDONLY)
        except:
            continue

        os.close(fd)

        if rhpl.getArch() != "ia64":
            cmd = "/usr/sbin/mkdosfs"

            if os.access("/sbin/mkdosfs", os.X_OK):
                cmd = "/sbin/mkdosfs"

            iutil.execWithRedirect (cmd, ["/tmp/floppy"], stdout = '/dev/tty5',
                                    stderr = '/dev/tty5')

        try:
            isys.mount(device, "/tmp/crash", fstype = "vfat")
        except SystemError:
            continue

        # copy trace dump we wrote to local storage to floppy
        try:
            shutil.copyfile("/tmp/anacdump.txt", "/tmp/crash/anacdump.txt")
        except:
            log.error("Failed to copy anacdump.txt to floppy")
            return 2

        isys.umount("/tmp/crash")
        return 0
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:55,代码来源:exception.py


示例10: has_iscsi

def has_iscsi():
    find_iscsi_files()
    if ISCSID == "" or not has_libiscsi or rhpl.getArch() in ("s390", "s390x"):
        return False

    log.info("ISCSID is %s" % (ISCSID,))

    # make sure the module is loaded
    if not os.access("/sys/module/iscsi_tcp", os.X_OK):
        return False
    return True
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:11,代码来源:iscsi.py


示例11: getPPCMachine

def getPPCMachine():

    if rhpl.getArch() != "ppc":
        return 0

    machine = rhpl.getPPCMachine()
    if machine is None:
        log.warning("Unable to find PowerPC machine type")
    elif machine == 0:
        log.warning("Unknown PowerPC machine type: %s" % (machine,))

    return machine
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:12,代码来源:iutil.py


示例12: getPPCMacBook

def getPPCMacBook():
    if rhpl.getArch() != "ppc":
        return 0
    if getPPCMachine() != "PMac":
        return 0

    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()

    for line in lines:
        if not string.find(string.lower(line), "book") == -1:
            return 1
    return 0
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:14,代码来源:iutil.py


示例13: hasiSeriesNativeStorage

def hasiSeriesNativeStorage():
    if rhpl.getArch() != "ppc":
        return

    f = open("/proc/modules", "r")
    lines = f.readlines()
    f.close()

    for line in lines:
        if line.startswith("ibmsis"):
            return 1
        if line.startswith("ipr"):
            return 1

    return 0
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:15,代码来源:iutil.py


示例14: isMactel

def isMactel():
    global mactel
    if mactel is not None:
        return mactel

    if rhpl.getArch() not in ("x86_64", "i386"):
        mactel = False
    elif not os.path.exists("/usr/sbin/dmidecode"):
        mactel = False
    else:
        buf = execWithCapture("/usr/sbin/dmidecode", ["dmidecode", "-s", "system-manufacturer"])
        if buf.lower().find("apple") != -1:
            mactel = True
        else:
            mactel = False
    return mactel
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:16,代码来源:iutil.py


示例15: getNext

    def getNext (self):
        for entry in self.migent:
            if rhpl.getArch() == "ia64" \
                    and entry.getMountPoint() == "/boot/efi":
                continue
            entry.setFormat(0)
            entry.setMigrate(0)
            entry.fsystem = entry.origfsystem

        for (cb, entry) in self.cbs:
            if cb.get_active():
                entry.setFileSystemType(fileSystemTypeGet("ext3"))
                entry.setFormat(0)
                entry.setMigrate(1)
                
        return None
开发者ID:abelboldu,项目名称:anaconda-ee,代码行数:16,代码来源:upgrade_migratefs_gui.py


示例16: reset

    def reset(self):
        # Reset everything except: 
        #
        #	- The mouse
        #	- The install language
        #	- The keyboard

        self.instClass = None
        self.network = network.Network()
        self.iscsi = iscsi.iscsi()
        self.zfcp = zfcp.ZFCP()
        self.firewall = firewall.Firewall()
        self.security = security.Security()
        self.timezone = timezone.Timezone()
        self.abiquo = abiquo.Abiquo()
        self.abiquo_rs = abiquo_rs.AbiquoRS()
        self.abiquo_v2v = abiquo_v2v.AbiquoV2V()
        self.users = None
        self.rootPassword = { "isCrypted": False, "password": "" }
        self.abiquoPassword = "xabiquo"
        self.abiquoPasswordHex = "c69a39bd64ffb77ea7ee3369dce742f3"
        self.auth = "--enableshadow --enablemd5"
        self.desktop = desktop.Desktop()
        self.upgrade = None
        # XXX move fsset and/or diskset into Partitions object?
        self.fsset.reset()
        self.diskset = partedUtils.DiskSet(self.anaconda)
        self.partitions = partitions.Partitions()
        self.bootloader = bootloader.getBootloader()
        self.dependencies = []
        self.dbpath = None
        self.upgradeRoot = None
        self.rootParts = None
        self.upgradeSwapInfo = None
        self.upgradeDeps = ""
        self.upgradeRemove = []
        self.upgradeInfoFound = None

        if rhpl.getArch() == "s390":
            self.firstboot = FIRSTBOOT_SKIP
        else:
            self.firstboot = FIRSTBOOT_DEFAULT

        # XXX I expect this to die in the future when we have a single data
        # class and translate ksdata into that instead.
        self.ksdata = None
开发者ID:abiquo,项目名称:anaconda-ee,代码行数:46,代码来源:instdata.py


示例17: isCell

def isCell():
    global cell
    if cell is not None:
        return cell

    cell = False
    if rhpl.getArch() != "ppc":
        return cell

    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()

    for line in lines:
        if not string.find(line, "Cell") == -1:
            cell = True

    return cell
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:18,代码来源:iutil.py


示例18: writeKS

    def writeKS(self, f, desktop, ksconfig):
        if self.skipx:
            f.write("skipx\n")
            return

        # We don't want to write out the X config arguments unless they
        # were previously specified in kickstart.
        args = []
        if desktop:
	    rl = desktop.getDefaultRunLevel() 
	    if rl and str(rl) == '5': 
		args += ['--startxonboot'] 
	    gui = desktop.getDefaultDesktop() 
	    if gui: 
		args += ['--defaultdesktop', string.lower(gui)] 

        # We don't want anything else on s390.
        if rhpl.getArch() == "s390" and args != []:
            f.write("xconfig %s\n" % string.join(args, " "))

        if ksconfig:
            if ksconfig.xconfig["driver"] != "":
                args += [ "--driver", ksconfig.xconfig["driver"] ]
            if ksconfig.xconfig["videoRam"] != "":
                args += [ "--videoram", ksconfig.xconfig["videoRam"] ]
            if ksconfig.xconfig["resolution"] != "":
                args += [ "--resolution", ksconfig.xconfig["resolution"] ]
            if ksconfig.xconfig["depth"] != 0:
                args += [ "--depth", str(ksconfig.xconfig["depth"]) ]

        if args != []:
            f.write("xconfig %s\n" % string.join(args, " "))

        args = []
        if ksconfig:
            if ksconfig.monitor["monitor"] != "":
                args += [ "--monitor", ksconfig.monitor["monitor"] ]
            if ksconfig.monitor["hsync"] != "":
                args += [ "--hsync", ksconfig.monitor["hsync"] ]
            if ksconfig.monitor["vsync"] != "":
                args += [ "--vsync", ksconfig.monitor["vsync"] ]

        if args != []:
            f.write("monitor %s\n" % string.join(args, " "))
开发者ID:abiquo-rpms,项目名称:anaconda-ee,代码行数:44,代码来源:xsetup.py


示例19: getPPCMacID

def getPPCMacID():
    machine = None

    if rhpl.getArch() != "ppc":
        return 0
    if getPPCMachine() != "PMac":
        return 0

    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()
    for line in lines:
        if line.find("machine") != -1:
            machine = line.split(":")[1]
            machine = machine.strip()
            return machine

    log.warning("No Power Mac machine id")
    return 0
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:19,代码来源:iutil.py


示例20: cpuFeatureFlags

def cpuFeatureFlags():
    """Convenience function to get CPU feature flags from /proc/cpuinfo."""

    if rhpl.getArch() not in ("i386", "x86_64"):
        return False
    f = open("/proc/cpuinfo", "r")
    lines = f.readlines()
    f.close()

    for line in lines:
        if not line.startswith("flags"):
            continue
        # get the actual flags
        flags = line[:-1].split(":", 1)[1]
        # and split them
        flst = flags.split(" ")
        return flst

    return []
开发者ID:sergey-senozhatsky,项目名称:anaconda-11-vlan-support,代码行数:19,代码来源:iutil.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python translate._函数代码示例发布时间:2022-05-26
下一篇:
Python user.UserModel类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap