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


Python EmergeDebug.setVerbose方法代码示例

本文整理汇总了Python中EmergeDebug.setVerbose方法的典型用法代码示例。如果您正苦于以下问题:Python EmergeDebug.setVerbose方法的具体用法?Python EmergeDebug.setVerbose怎么用?Python EmergeDebug.setVerbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmergeDebug的用法示例。



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

示例1: setUp

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import setVerbose [as 别名]
 def setUp(self):
     EmergeDebug.setVerbose(int(os.environ["EMERGE_TEST_VERBOSITY"]))
     self.kdeRoot = tempfile.TemporaryDirectory()
     emergeRoot = os.path.normpath(os.path.join(os.path.split(__file__)[0], "..", "..", ".."))
     EmergeConfig.emergeSettings = EmergeConfig.EmergeConfig(os.path.join(emergeRoot, "emerge", "kdesettings.ini"))
     EmergeConfig.EmergeStandardDirs.allowShortpaths(False)
     EmergeConfig.EmergeStandardDirs._pathCache().clear()
     EmergeConfig.EmergeStandardDirs._pathCache()["EMERGEROOT"] = self.kdeRoot.name
     os.environ["KDEROOT"] = self.kdeRoot.name
     EmergeConfig.emergeSettings.set("General", "EMERGE_PORTAGE_ROOT", os.path.join(emergeRoot, "emerge", "portage") )
     EmergeConfig.emergeSettings.set("Compile","BuildType", "RelWithDebInfo")
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:13,代码来源:EmergeTestBase.py


示例2: main

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import setVerbose [as 别名]
def main():
    """Run all the tests in the emerge test suite"""

    parser = optparse.OptionParser()
    parser.set_defaults(verbosity=1)
    parser.add_option("-v", "--verbose", action="store_const", const=3,
                      dest="verbosity")
    opts, rest = parser.parse_args()

    EmergeDebug.setVerbose(opts.verbosity)
    os.environ["EMERGE_TEST_VERBOSITY"] = str(opts.verbosity)

    loader = unittest.TestLoader()
    suite = loader.discover(start_dir=thisdir)
    runner = unittest.TextTestRunner(verbosity = opts.verbosity + 1)
    result = runner.run(suite)

    sys.exit(not result.wasSuccessful())
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:20,代码来源:runtests.py


示例3: setUp

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import setVerbose [as 别名]
 def setUp(self):
     EmergeDebug.setVerbose(int(os.environ["EMERGE_TEST_VERBOSITY"]))
     self.kdeRoot = tempfile.TemporaryDirectory()
     EmergeConfig.EmergeStandardDirs.allowShortpaths(False)
     EmergeConfig.EmergeStandardDirs._pathCache()["EMERGEROOT"] = self.kdeRoot.name
     os.environ["KDEROOT"] = self.kdeRoot.name
开发者ID:TheOneRing,项目名称:emerge,代码行数:8,代码来源:EmergeTestBase.py


示例4: _replaceSetting

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import setVerbose [as 别名]

def _replaceSetting(reg,new,text):
        return re.compile(reg, re.MULTILINE).sub(new,text)

def resetSettings():
    with open( os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini.backup"),"rt+") as fin:
        text = fin.read()
    text = _replaceSetting("^PACKAGE_IGNORES.*$", "PACKAGE_IGNORES =", text)
    text = _replaceSetting("^EMERGE_USE_CCACHE.*$", "#EMERGE_USE_CCACHE = True", text)
    text = _replaceSetting("^Python =.*$", "Python = C:\python34", text)
    text = _replaceSetting("^DOWNLOADDIR =.*$", "#DOWNLOADDIR = C:\kde\download", text)
    with open( os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini"),"wt+") as fout:
        fout.write(text)

if __name__ == "__main__":
    EmergeDebug.setVerbose(3)
    # we don't use the db directly and the file must not be locked
    del InstallDB.installdb
    backup()
    removeFromDB("dev-util")
    removeFromDB("gnuwin32")
    # we cant use the ini support to modify the settings as it would kill the comments
    resetSettings()
    utils.system("cd %s && git clean -xdf" % os.path.join(EmergeStandardDirs.emergeRoot(), "emerge"))
    utils.createDir(EmergeStandardDirs.tmpDir())
    archiveName = os.path.join(EmergeStandardDirs.tmpDir(), "framewroks-sdk-%s-%s-%s.7z" % (compiler.getCompilerName(), compiler.architecture(), datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d')))
    utils.deleteFile(archiveName)
    utils.system("7za  a %s %s -x!build -x!msys -x!dev-utils -x!tmp -x!mingw* -x!etc/kdesettings.ini.backup -x!etc/portage/install.db.backup" % ( archiveName, EmergeStandardDirs.emergeRoot()))
    #utils.copyFile(os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini"), os.path.join( EmergeStandardDirs.etcDir(), "kdesettings.ini.backup2"),linkOnly=False)
    restore()
开发者ID:TheOneRing,项目名称:emerge,代码行数:32,代码来源:prepare-sdk.py


示例5: main

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import setVerbose [as 别名]

#.........这里部分代码省略.........
    parser.add_argument( "--log-dir", action = "store",
                         default = emergeSettings.get( "General", "EMERGE_LOG_DIR", "" ),
                         help = "This will log the build output to a logfile in LOG_DIR for each package. Logging information is appended to existing logs." )
    parser.add_argument( "--dt", action = "store", choices = [ "both", "runtime", "buildtime" ], default = "both",
                         dest = "dependencyType" )
    parser.add_argument( "--update-fast", action = "store_true",
                         help = "If the package is installed from svn/git and the revision did not change all steps after fetch are skipped" )
    parser.add_argument( "-d", "--dependencydepth", action = "store", type = int, default = -1,
                         help = "By default emerge resolves the whole dependency graph, this option limits the depth of the graph, so a value of 1 would mean only dependencies defined in that package" )

    actionHandler = ActionHandler(parser)
    for x in sorted( [ "fetch", "unpack", "configure", "compile", "make",
                       "install", "install-deps", "qmerge", "manifest", "package", "unmerge", "test",
                       "checkdigest", "dumpdeps",
                       "full-package", "cleanimage", "cleanbuild", "createpatch", "geturls"] ):
        actionHandler.addAction( x )
    actionHandler.addAction( "update", help = "Update a single package" )

    # read-only actions
    actionHandler.addAction( "print-source-version" )
    actionHandler.addAction( "print-package-version" )
    actionHandler.addAction( "print-targets",
                             help = "This will show a list of available targets for the package" )
    actionHandler.addAction( "print-installed",
                             help = "This will show a list of all packages that are installed currently." )
    actionHandler.addAction( "print-installable",
                             help = "This will give you a list of packages that can be installed. Currently you don't need to enter the category and package: only the package will be enough." )
    actionHandler.addAction( "print-revision", help = "Print the revision of the package and exit" )
    actionHandler.addAction( "print-files", help = "Print the files installed by the package and exit" )
    actionHandler.addActionWithArg( "search-file", help = "Print packages owning the file" )

    # other actions
    actionHandler.addActionWithArg( "dump-deps-file", dest = "dumpDepsFile",
                                    help = "Output the dependencies of this package as a csv file suitable for emerge server." )
    actionHandler.addAction( "generate-jenkins-job")

    parser.add_argument( "packageNames", nargs = argparse.REMAINDER )

    args = parser.parse_args( )

    action, error = actionHandler.parseFinalAction(args, "all")
    if not action:
        EmergeDebug.error("Failed to parse arguments: %s" % error)
        return False

    if args.stayQuiet:
        EmergeDebug.setVerbose(-1)
    elif args.verbose:
        EmergeDebug.setVerbose(args.verbose)

    emergeSettings.set( "General", "WorkOffline", args.offline )
    emergeSettings.set( "General", "EMERGE_NOCOPY", args.nocopy )
    emergeSettings.set( "General", "EMERGE_NOCLEAN", args.noclean )
    emergeSettings.set( "General", "EMERGE_FORCED", args.forced )
    emergeSettings.set( "General", "EMERGE_BUILDTESTS", args.buildTests )
    emergeSettings.set( "General", "EMERGE_BUILDTYPE", args.buildType )
    emergeSettings.set( "PortageVersions", "DefaultTarget", args.target )
    emergeSettings.set( "General", "EMERGE_OPTIONS", ";".join( args.options ) )
    emergeSettings.set( "General", "EMERGE_LOG_DIR", args.log_dir )
    emergeSettings.set( "General", "EMERGE_TRACE", args.trace )
    emergeSettings.set( "General", "EMERGE_PKGPATCHLVL", args.patchlevel )

    portage.PortageInstance.options = args.options
    if args.search:
        for package in args.packageNames:
            category = ""
            if not package.find( "/" ) == -1:
                (category, package) = package.split( "/" )
            portageSearch.printSearch( category, package )
        return True

    if action in [ "install-deps", "update", "update-all", "package" ] or args.update_fast:
        args.ignoreInstalled = True

    if action in [ "update", "update-all" ]:
        args.noclean = True

    EmergeDebug.debug("buildAction: %s" % action)
    EmergeDebug.debug("doPretend: %s" % args.probe, 1)
    EmergeDebug.debug("packageName: %s" % args.packageNames)
    EmergeDebug.debug("buildType: %s" % args.buildType)
    EmergeDebug.debug("buildTests: %s" % args.buildTests)
    EmergeDebug.debug("verbose: %d" % EmergeDebug.verbose(), 1)
    EmergeDebug.debug("trace: %s" % args.trace, 1)
    EmergeDebug.debug("KDEROOT: %s" % EmergeStandardDirs.emergeRoot(), 1)
    EmergeDebug.debug_line()

    if args.print_installed:
        InstallDB.printInstalled( )
    elif args.print_installable:
        portage.printInstallables( )
    elif args.search_file:
        portage.printPackagesForFileSearch(args.search_file)
    elif args.list_file:
        handleSinglePackage( "", action, args )
    else:
        for packageName in args.packageNames:
            if not handleSinglePackage( packageName, action, args ):
                return False
    return True
开发者ID:TheOneRing,项目名称:emerge,代码行数:104,代码来源:emerge.py



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