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

Python configutils.getValue函数代码示例

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

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



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

示例1: runthread

 def runthread(self):
     # Generate the package manifest
     logger.logV(self.tn, logger.I, _("Generating package manifests"))
     logger.logVV(self.tn, logger.I, _(
         "Generating filesystem.manifest and filesystem.manifest-desktop"))
     writer = open(isotreel + "casper/filesystem.manifest", "w")
     writer_desktop = open(
         isotreel + "casper/filesystem.manifest-desktop", "w")
     for i in config.AptCache:
         if i.installedVersion is None or len(i.installedVersion) <= 0:
             continue
         name = i.fullname.strip()
         ver = i.installedVersion.strip()
         strs = name + " " + ver + "\n"
         writer.write(strs)
         if (not name in
                 configutils.getValue(configs[configutils.remafterinst])):
             writer_desktop.write(strs)
     writer.close()
     writer_desktop.close()
     logger.logVV(
         self.tn, logger.I, _("Generating filesytem.manifest-remove"))
     writer = open(isotreel + "casper/filesystem.manifest-remove", "w")
     for i in configutils.parseMultipleValues(configutils.getValue(configs[configutils.remafterinst])):
         writer.write(i.strip() + "\n")
     writer.close()
开发者ID:KeithIMyers,项目名称:relinux,代码行数:26,代码来源:isoutil.py


示例2: run

 def run(self):
     # Edit the casper.conf
     # Strangely enough, casper uses the "quiet" flag if the build system is either Debian or Ubuntu
     if config.VStatus is False:
         logger.logI(self.tn, _("Editing casper and LSB configuration files"))
     logger.logV(self.tn, _("Editing casper.conf"))
     buildsys = "Ubuntu"
     if configutils.parseBoolean(configutils.getValue(configs[configutils.casperquiet])) is False:
         buildsys = ""
     unionfs = configutils.getValue(configs[configutils.unionfs])
     if unionfs == "overlayfs" and aptutil.compVersions(aptutil.getPkgVersion(aptutil.getPkg("casper", aptcache)), "1.272", aptutil.lt):
         logger.logW(self.tn, _("Using DEFAULT instead of overlayfs"))
         unionfs = "DEFAULT"
     self.varEditor(tmpsys + "etc/casper.conf", {
                                         "USERNAME": configutils.getValue(configs[configutils.username]),
                                         "USERFULLNAME":
                                             configutils.getValue(configs[configutils.userfullname]),
                                         "HOST": configutils.getValue(configs[configutils.host]),
                                         "BUILD_SYSTEM": buildsys,
                                         "FLAVOUR": configutils.getValue(configs[configutils.flavour]),
                                         "UNIONFS": unionfs})
     logger.logV(self.tn, _("Editing lsb-release"))
     self.varEditor(tmpsys + "etc/lsb-release", {
                                 "DISTRIB_ID": configutils.getValue(configs[configutils.sysname]),
                                 "DISTRIB_RELEASE": configutils.getValue(configs[configutils.version]),
                                 "DISTRIB_CODENAME": configutils.getValue(configs[configutils.codename]),
                                 "DISTRIB_DESCRIPTION":
     configutils.getValue(configs[configutils.description])})
开发者ID:fusionlightcat,项目名称:relinux,代码行数:28,代码来源:tempsys.py


示例3: run

 def run(self):
     logger.logI(tn, _("Generating compressed filesystem"))
     # Generate the SquashFS file
     # Options:
     # -b 1M                    Use a 1M blocksize (maximum)
     # -no-recovery             No recovery files
     # -always-use-fragments    Fragment blocks for files larger than the blocksize (1M)
     # -comp                    Compression type
     logger.logVV(tn, _("Generating options"))
     opts = "-b 1M -no-recovery -no-duplicates -always-use-fragments"
     opts = opts + " -comp " + configutils.getValue(configs[configutils.sfscomp])
     opts = opts + " " + configutils.getValue(configs[configutils.sfsopts])
     sfsex = "dev etc home media mnt proc sys var usr/lib/ubiquity/apt-setup/generators/40cdrom"
     sfspath = isotreel + "casper/filesystem.squashfs"
     logger.logI(tn, _("Adding the edited /etc and /var to the filesystem"))
     os.system("mksquashfs " + tmpsys + " " + sfspath + " " + opts)
     logger.logI(tn, _("Adding the rest of the system"))
     os.system("mksquashfs / " + sfspath + " " + opts + " -e " + sfsex)
     # Make sure the SquashFS file is OK
     doSFSChecks(sfspath, int(configutils.getValue(configs[configutils.isolevel])))
     # Find the size after it is uncompressed
     logger.logV(tn, _("Writing the size"))
     files = open(isotreel + "casper/filesystem.size", "w")
     files.write(fsutil.getSFSInstSize(sfspath) + "\n")
     files.close()
开发者ID:fusionlightcat,项目名称:relinux,代码行数:25,代码来源:squashfs.py


示例4: runthread

    def runthread(self):
        # Generate the package manifest
        logger.logV(self.tn, logger.I, _("Generating package manifests"))
        logger.logVV(self.tn, logger.I, _(
            "Generating filesystem.manifest and filesystem.manifest-desktop"))
        writer = open(isotreel + "casper/filesystem.manifest", "w")
        writer_desktop = open(
            isotreel + "casper/filesystem.manifest-desktop", "w")

        # installedVersion throws an error when it doesn't exist in 'Package'
        # TODO: figure out why, but for now.. check for attribute as well
        for i in config.AptCache:
            if not hasattr(i,'installedVersion') or i.installedVersion is None or len(i.installedVersion) <= 0:
                continue
            name = i.fullname.strip()
            ver = i.installedVersion.strip()
            strs = name + " " + ver + "\n"
            writer.write(strs)
            if (not name in
                    configutils.getValue(configs[configutils.remafterinst])):
                writer_desktop.write(strs)
        writer.close()
        writer_desktop.close()
        logger.logVV(
            self.tn, logger.I, _("Generating filesytem.manifest-remove"))
        writer = open(isotreel + "casper/filesystem.manifest-remove", "w")
        for i in configutils.parseMultipleValues(configutils.getValue(configs[configutils.remafterinst])):
            writer.write(i.strip() + "\n")
        writer.close()
开发者ID:fporter,项目名称:relinux,代码行数:29,代码来源:isoutil.py


示例5: run

 def run(self):
     if configutils.parseBoolean(configutils.getValue(configs[configutils.enablewubi])) is True:
         logger.logV(self.tn, _("Generating the windows autorun.inf"))
         files = open(isotreel + "autorun.inf", "w")
         files.write("[autorun]\n")
         files.write("open=wubi.exe\n")
         files.write("icon=wubi.exe,0\n")
         files.write("label=Install " + configutils.getValue(configs[configutils.sysname]) + "\n")
         files.write("\n")
         files.write("[Content]\n")
         files.write("MusicFiles=false\n")
         files.write("PictureFiles=false\n")
         files.write("VideoFiles=false\n")
         files.close()
开发者ID:fusionlightcat,项目名称:relinux,代码行数:14,代码来源:isoutil.py


示例6: onWrite

 def onWrite(msg):
     if not configutils.getValue(config.Configuration["Relinux"]["EXPERIMENTFEATURES"]):
         return
     ui.terminal.moveCursor(QtGui.QTextCursor.End, QtGui.QTextCursor.MoveAnchor)
     QtCore.QMetaObject.invokeMethod(
         ui.terminal, "insertPlainText", QtCore.Qt.QueuedConnection, QtCore.Q_ARG("QString", msg.rstrip() + "\n")
     )
开发者ID:nazuk,项目名称:relinux,代码行数:7,代码来源:__init__.py


示例7: runthread

 def runthread(self):
     logger.logI(self.tn, logger.I, _("Copying files to the temporary filesystem"))
     excludes = configutils.parseMultipleValues(configutils.getValue(configs[configutils.excludes]))
     varexcludes = excludes
     # Exclude all log files (*.log *.log.*), PID files (to show that no daemons are running),
     # backup and old files (for obvious reasons), and any .deb files that a person might have downloaded
     varexcludes.extend(["*.log", "*.log.*", "*.pid", "*/pid", "*.bak", "*.[0-9].gz", "*.deb"])
     fsutil.fscopy("/etc", tmpsys + "etc", excludes, self.tn)
     fsutil.fscopy("/var", tmpsys + "var", varexcludes, self.tn)
开发者ID:Smile4ever,项目名称:relinux,代码行数:9,代码来源:tempsys.py


示例8: runthread

 def runthread(self):
     self.event = threading.Event()
     self.ap = aptutil.AcquireProgress(lambda p: self.percentfunc(p / 2))
     self.ip = aptutil.InstallProgress(
         lambda p: self.percentfunc(50 + p / 2),
         lambda: self.finishfunc(self.event))
     logger.logI(self.tn, logger.I, _("Setting up distro dependencies"))
     logger.logV(self.tn, logger.I, _("Setting up Ubiquity"))
     if configutils.getValue(configs[configutils.instfront]).lower() == "kde":
         self.instPkg("ubiquity-frontend-kde", True)
         self.remPkg("ubiquity-frontend-gtk")
     else:
         self.instPkg("ubiquity-frontend-gtk", True)
         self.remPkg("ubiquity-frontend-kde")
     logger.logV(self.tn, logger.I, _("Setting up Popularity Contest"))
     if configutils.getValue(configs[configutils.popcon]):
         self.instPkg("popularity-contest")
     else:
         self.remPkg("popularity-contest")
     if configutils.getValue(configs[configutils.memtest]):
         logger.logV(self.tn, logger.I, _("Setting up memtest86+"))
         self.instPkg("memtest86+")
     logger.logV(
         self.tn, logger.I, _("Setting up other distro dependencies"))
     self.instPkg("ubuntu-minimal")
     self.instPkg("syslinux", True)
     self.instPkg("discover")
     self.instPkg("coreutils")
     self.instPkg("bash")
     self.instPkg("initramfs-tools")
     self.instPkg("casper")
     self.instPkg("laptop-detect")
     logger.logI(self.tn, logger.I, _(
         "Setting up relinux generation dependencies"))
     self.instPkg("squashfs-tools", True)
     self.instPkg("genisoimage", True)
     configutils.saveBuffer(config.Configuration)
     aptutil.commitChanges(self.aptcache, self.ap, self.ip)
     self.exec_()
开发者ID:KeithIMyers,项目名称:relinux,代码行数:39,代码来源:setup.py


示例9: runthread

 def runthread(self):
     # Generate the package manifest
     logger.logV(self.tn, logger.I, _("Generating package manifests"))
     logger.logVV(self.tn, logger.I, _("Generating filesystem.manifest and filesystem.manifest-desktop"))
     pkglistu = config.AptCache.packages
     writer = open(isotreel + "casper/filesystem.manifest", "w")
     writer_desktop = open(isotreel + "casper/filesystem.manifest-desktop", "w")
     for i in pkglistu:
         if i.current_ver == None:
             continue
         name = i.get_fullname(True).strip()
         ver = i.current_ver.ver_str.strip()
         strs = name + " " + ver + "\n"
         writer.write(strs)
         if (not name in
             configutils.parseMultipleValues(configutils.getValue(configs[configutils.remafterinst]))):
             writer_desktop.write(strs)
     writer.close()
     writer_desktop.close()
     logger.logVV(self.tn, logger.I, _("Generating filesytem.manifest-remove"))
     writer = open(isotreel + "casper/filesystem.manifest-remove", "w")
     for i in configutils.parseMultipleValues(configutils.getValue(configs[configutils.remafterinst])):
         writer.write(i.strip() + "\n")
     writer.close()
开发者ID:Smile4ever,项目名称:relinux,代码行数:24,代码来源:isoutil.py


示例10: runthread

 def runthread(self):
     # If the user-setup-apply file does not exist, and there is an alternative, we'll copy it over
     logger.logI(self.tn, logger.I, _("Setting up the installer"))
     if (os.path.isfile("/usr/lib/ubiquity/user-setup/user-setup-apply.orig") and not
             os.path.isfile("/usr/lib/ubiquity/user-setup/user-setup-apply")):
         shutil.copy2("/usr/lib/ubiquity/user-setup/user-setup-apply.orig",
                      "/usr/lib/ubiquity/user-setup/user-setup-apply")
     if (True or
             configutils.getValue(configs[configutils.aptlistchange])):
         if not os.path.exists("/usr/share/ubiquity/apt-setup.relinux-backup"):
             os.rename("/usr/share/ubiquity/apt-setup",
                       "/usr/share/ubiquity/apt-setup.relinux-backup")
         aptsetup = open("/usr/share/ubiquity/apt-setup", "w")
         aptsetup.write("#!/bin/sh\n")
         aptsetup.write("exit\n")
         aptsetup.close()
开发者ID:ali-hallaji,项目名称:relinux,代码行数:16,代码来源:tempsys.py


示例11: run

def run(adict):
    global configs, aptcache, page, isotreel, tmpsys
    configs = adict["config"]["OSWeaver"]
    isodir = configutils.getValue(configs[configutils.isodir])
    isotreel = isodir + "/.ISO_STRUCTURE/"
    tmpsys = isodir + "/.TMPSYS/"
    aptcache = adict["aptcache"]
    ourgui = adict["gui"]
    pagenum = ourgui.wizard.add_tab()
    page = gui.Frame(ourgui.wizard.page(pagenum))
    ourgui.wizard.add_page_body(pagenum, _("OSWeaver"), page)
    page.frame = gui.Frame(page, borderwidth=2, relief=Tkinter.GROOVE)
    page.progress = gui.Progressbar(page)
    page.progress.pack(fill=Tkinter.X, expand=True, side=Tkinter.BOTTOM,
                          anchor=Tkinter.S)
    page.frame.pack(fill=Tkinter.BOTH, expand=True, anchor=Tkinter.CENTER)
    page.button = gui.Button(page.frame, text="Start!", command=runThreads)
    page.button.pack()
开发者ID:fusionlightcat,项目名称:relinux,代码行数:18,代码来源:__init__.py


示例12: runthread

 def runthread(self):
     # If the user-setup-apply file does not exist, and there is an alternative, we'll copy it over
     logger.logI(self.tn, logger.I, _("Setting up the installer"))
     if (os.path.isfile("/usr/lib/ubiquity/user-setup/user-setup-apply.orig") and not
             os.path.isfile("/usr/lib/ubiquity/user-setup/user-setup-apply")):
         shutil.copy2("/usr/lib/ubiquity/user-setup/user-setup-apply.orig",
                      "/usr/lib/ubiquity/user-setup/user-setup-apply")
     # If the user requested to make sure that the installer does _not_ change the apt sources,
     #  make sure that relinux obeys this.
     # However, if the user changed his/her mind, we want to make sure that relinux
     #  work with that too
     if not configutils.getValue(configs[configutils.aptlistchange]):
         if not os.path.exists("/usr/share/ubiquity/apt-setup.relinux-backup"):
             os.rename("/usr/share/ubiquity/apt-setup",
                       "/usr/share/ubiquity/apt-setup.relinux-backup")
         aptsetup = open("/usr/share/ubiquity/apt-setup", "w")
         aptsetup.write("\n")
         aptsetup.close()
         fsutil.chmod("/usr/share/ubiquity/apt-setup", 0o755, self.tn)
     elif os.path.exists("/usr/share/ubiquity/apt-setup.relinux-backup"):
         # TODO: Fix the 40cdrom bug?
         fsutil.rm("/usr/share/ubiquity/apt-setup", False, self.tn)
         os.rename("/usr/share/ubiquity/apt-setup.relinux-backup",
                       "/usr/share/ubiquity/apt-setup")
开发者ID:AnonymousMeerkat,项目名称:relinux,代码行数:24,代码来源:tempsys.py


示例13: writeAll

def writeAll(status, lists, tn, importance, text, **options):
    if tn == "" or tn is None or not status:
        return
    text_ = "[" + tn + "] "
    if importance == E:
        text_ += MError
    elif importance == W:
        text_ += MWarning
    elif importance == D:
        text_ += MDebug
        from relinux import configutils
        if not configutils.getValue(config.Configuration["Relinux"]["DEBUG"]):
            return
    else:
        text_ += ""
    text__ = text_ + text
    text = text__
    for i in lists:
        if i in config.TermStreams and "noterm" in options and options["noterm"]:
            continue
        if i == config.GUIStream and "nogui" in options and options["nogui"]:
            continue
        text_ = copy.copy(text)
        if i in config.TermStreams:
            text__ = "\033["
            if importance == E:
                text__ += str(config.TermRed)
            elif importance == W:
                text__ += str(config.TermYellow)
            elif importance == D:
                text__ += str(config.TermGreen)
            '''elif importance == I:
                text__ += config.TermBlue'''
            text__ += "m" + text_ + "\033[" + str(config.TermReset) + "m"
            text_ = text__
        i.write(utilities.utf8(text_ + MNewline))
开发者ID:KeithIMyers,项目名称:relinux,代码行数:36,代码来源:logger.py


示例14: getDiskName

def getDiskName():
    return configutils.getValue(configs[configutils.label]) + " - Release " + config.Arch
开发者ID:KeithIMyers,项目名称:relinux,代码行数:2,代码来源:isoutil.py


示例15: main


#.........这里部分代码省略.........
        cbuffer = configutils.parseFiles(configfiles)
        config.Configuration = cbuffer
        configutils.saveBuffer(config.Configuration)
        \'''for i in configutils.beautify(buffer1):
            print(i)\'''
        spprog += 1
        splash.setProgress(
            calcPercent((spprog, spprogn)), "Reading APT Cache...")
        def aptupdate(op, percent):
            global minis
            if percent != None:
                minis += utilities.floatDivision(percent, 100)
            splash.setProgress(
                calcPercent((utilities.floatDivision(
                    minis + captop, aptops) + spprog, spprogn)),
                               "Reading APT Cache... (" + op + ")")
        def aptdone(op):
            global minis, captop
            minis = 0.0
            captop += 1
        aptcache = aptutil.getCache(aptutil.OpProgress(aptupdate, aptdone))
        config.AptCache = aptcache
        spprog += 1
        splash.setProgress(
            calcPercent((spprog, spprogn)), "Loading the GUI...")
        App = gui.GUI(root)
        spprog += 1
        splash.setProgress(
            calcPercent((spprog, spprogn)), "Filling in configuration...")
        App.fillConfiguration(cbuffer)
        spprog += 1
        splash.setProgress(
            calcPercent((spprog, spprogn)), "Running modules...")
        for i in modules:
            modloader.runModule(i,
                                {"gui": App, "config": cbuffer, "aptcache": aptcache})
        spprog += 1
        splash.setProgress(calcPercent((spprog, spprogn)), "Launching relinux")
    splash = gui.Splash(root, startProg)
    #root.overrideredirect(Tkinter.TRUE) # Coming soon!
    root.mainloop()'''
    App = QtGui.QApplication(sys.argv)
    splash = QtGui.QSplashScreen(
        QtGui.QPixmap(relinuxdir + "/splash_light.png"))
    splash.show()
    App.processEvents()
    def showMessage(str_):
        splash.showMessage(
            str_ + "...", QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom)
        App.processEvents()
    showMessage(_("Loading modules"))
    modules = []
    modulemetas = modloader.getModules()
    for i in modulemetas:
        modules.append(modloader.loadModule(i))
    showMessage(_("Loading configuration files"))
    configfiles = [relinuxdir + "/relinux.conf"]
    for i in range(len(modulemetas)):
        for x in modules[i].moduleconfig:
            if "RELINUXCONFDIR" in os.environ:
                configfiles.append(os.path.join(relinuxdir, x))
            else:
                configfiles.append(
                    os.path.join(os.path.dirname(modulemetas[i]["path"]), x))
    cbuffer = configutils.parseFiles(configfiles)
    config.Configuration = cbuffer
    configutils.saveBuffer(config.Configuration)
    logfilename = configutils.getValue(cbuffer["Relinux"]["LOGFILE"])
    logfile = open(logfilename, "a")
    config.EFiles.append(logfile)
    config.IFiles.append(logfile)
    config.VFiles.append(logfile)
    config.VVFiles.append(logfile)
    logger.logI(tn, logger.I, "===========================")
    logger.logI(tn, logger.I, "=== Started new session ===")
    logger.logI(tn, logger.I, "===========================")
    showMessage(_("Loading APT cache 0%"))
    def aptupdate(op, percent):
        global minis
        if percent:
            minis = int(percent)
        showMessage(
            _("Loading APT cache") + " (" + op + ") " + str(minis) + "%")
    aptcache = aptutil.getCache(aptutil.OpProgress(aptupdate, None))
    config.AptCache = aptcache
    if not args.nostylesheet:
        showMessage(_("Loading stylesheet"))
        App.setStyleSheet(open(mainsrcdir + "/stylesheet.css", "r").read())
    showMessage(_("Loading GUI"))
    gui_ = gui.GUI(App)
    config.Gui = gui_
    showMessage(_("Running modules"))
    for i in modules:
            modloader.runModule(i, {})
    gui_.show()
    splash.finish(gui_)
    exitcode = App.exec_()
    config.ThreadStop = True
    logfile.close()
    sys.exit(exitcode)
开发者ID:nazuk,项目名称:relinux,代码行数:101,代码来源:__main__.py


示例16: filenames

# -V label               Label of the ISO
# -cache-inodes          Enable caching inodes and device numbers
# -J                     Use Joliet specification to let pathnames use 64 characters
# -l                     Allow 31-character filenames (Joliet will replace this of course)
# -b bootimage           Boot with the specified image
# -c bootcatalog         Path to generate the boot catalog
# -no-emul-boot          Shows that the boot image specified is a "no emulation" image
#                           This means that the system will not perform any disk emulation when running it
# -boot-load-size 4      Number of virtual sectors to load
# -boot-info-table       Add a boot information table to the boot image
# -o file                Output image
# -input-charset utf-8   Use the UTF-8 input charset
# -iso-level isolevel    ISO Level
isogenopts = ("-r -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot " +
              "-boot-load-size 4 -boot-info-table -input-charset utf-8 -iso-level " +
              configutils.getValue(configs[configutils.isolevel]))


# Returns the disk name of the ISO
def getDiskName():
    return configutils.getValue(configs[configutils.label]) + " - Release " + config.Arch


# Shows a file not found error
def showFileNotFound(files, dirs, tn):
    logger.logE(tn, logger.E, files + " " + _("not found") + ". " + _("Copy") + " " + files +
                " " + _("to") + " " + dirs)


# Copy a file
def copyFile(src, dst, tn, critical=False):
开发者ID:KeithIMyers,项目名称:relinux,代码行数:31,代码来源:isoutil.py


示例17: run

def run(adict):
    global aptcache, page
    configs = adict["config"]["OSWeaver"]
    isodir = configutils.getValue(configs[configutils.isodir])
    config.ISOTree = isodir + "/.ISO_STRUCTURE/"
    print(config.ISOTree)
    config.TempSys = isodir + "/.TMPSYS/"
    aptcache = adict["aptcache"]
    ourgui = adict["gui"]
    from relinux.modules.osweaver import isoutil, squashfs, tempsys, ui_osweaver
    threads = []
    threads.extend(tempsys.threads)
    threads.extend(squashfs.threads)
    threads.extend(isoutil.threads)
    threads_ = utilities.remDuplicates(threads)
    threads = threads_
    '''pagenum = ourgui.wizard.add_tab()
    page = gui.Frame(ourgui.wizard.page(pagenum))
    ourgui.wizard.add_page_body(pagenum, _("OSWeaver"), page)
    page.frame = gui.Frame(page)
    page.details = gui.VerticalScrolledFrame(page, borderwidth = 1, relief = Tkinter.SOLID)
    page.details.output = gui.Label(page.details.interior, text = config.GUIStream.getvalue(), anchor = Tkinter.NW, justify = Tkinter.LEFT)
    def onWrite():
        page.details.output.config(text = config.GUIStream.getvalue())
        page.details.canvas.yview_moveto(1.0)
    config.GUIStream.writefunc.append(onWrite)
    page.details.output.pack(fill = Tkinter.BOTH, expand = True, anchor = Tkinter.NW, side = Tkinter.LEFT)
    page.details.pack(fill = Tkinter.BOTH, expand = True, side = Tkinter.BOTTOM, anchor = Tkinter.SW)
    \'''page.details.buttonstate = True
    def showDetails():
        if page.details.buttonstate:
            page.details.output.pack(fill=Tkinter.BOTH, expand=True, anchor=Tkinter.NW, side=Tkinter.LEFT)
            page.showdetails.config(text="<< Hide details")
            page.details.buttonstate = False
        else:
            page.details.output.pack_forget()
            page.showdetails.config(text="Show details >>")
            page.details.buttonstate = True
    page.showdetails = gui.Button(page, text="Show details >>", command=showDetails)
    page.showdetails.pack(side=Tkinter.BOTTOM, anchor=Tkinter.SW)\'''
    page.progress = gui.Progressbar(page)
    page.progress.pack(fill = Tkinter.X, expand = True, side = Tkinter.BOTTOM,
                          anchor = Tkinter.S)
    page.frame.pack(fill = Tkinter.BOTH, expand = True, anchor = Tkinter.CENTER)
    page.chframe = gui.VerticalScrolledFrame(page.frame)
    page.chframe.pack(fill = Tkinter.BOTH, expand = True, anchor = Tkinter.N)
    page.chframe.boxes = []
    page.chframe.dispthreads = []
    x = 0
    y = 0
    usedeps = gui.Checkbutton(page.chframe.interior, text = "Ignore dependencies")
    usedeps.grid(row = y, column = x)
    y += 1
    label = gui.Label(page.chframe.interior, text = "Select threads to run:")
    label.grid(row = y, column = x)
    y += 1
    class customCheck(gui.Checkbutton):
        def __init__(self, parent, *args, **kw):
            gui.Checkbutton.__init__(self, parent, *args, **kw)
            self.id = len(page.chframe.boxes)
            self.ignoreauto = True
            self.value.trace("w", self.autoSelect)

        def autoSelect(self, *args):
            id_ = self.id
            if self.ignoreauto:
                self.ignoreauto = False
                return
            if self.value.get() < 1:
                return
            if len(threads[id_]["deps"]) <= 0 or usedeps.value.get() > 0:
                return
            tns = []
            for i in threads[id_]["deps"]:
                tns.append(i["tn"])
            for i in range(len(threads)):
                if threads[i]["tn"] in tns:
                    page.chframe.boxes[i].value.set(1)
    for i in threads:
        temp = customCheck(page.chframe.interior, text = i["tn"])
        temp.value.set(1)
        temp.grid(row = y, column = x, sticky = Tkinter.NW)
        page.chframe.boxes.append(temp)
        x += 1
        if x >= 3:
            x = 0
            y += 1
    if x != 0:
        y += 1
    def selBoxes(all_):
        val = 0
        if all_ == None:
            for i in range(len(threads)):
                page.chframe.boxes[i].ignoreauto = True
                if page.chframe.boxes[i].value.get() < 1:
                    page.chframe.boxes[i].value.set(1)
                else:
                    page.chframe.boxes[i].value.set(0)
            return
        if all_:
#.........这里部分代码省略.........
开发者ID:Smile4ever,项目名称:relinux,代码行数:101,代码来源:__init__.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python logger.logI函数代码示例发布时间:2022-05-26
下一篇:
Python time.now函数代码示例发布时间: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