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


Python EmergeDebug.info方法代码示例

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

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

示例1: getNightlyVersionsFromUrl

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import info [as 别名]
 def getNightlyVersionsFromUrl(url, pattern, timeout = 10) -> [str]:
     """
     Returns a list of possible version number matching the regular expression in pattern.
     :param url: The url to look for the nightly builds.
     :param pattern: A regular expression to match the version.
     :param timeout:
     :return: A list of matching strings or [None]
     """
     if emergeSettings.getboolean("General", "WorkOffline"):
         EmergeDebug.info("Nightly builds unavailable for %s in offline mode." % url)
         return [None]
     if url in UtilsCache._NIGTHLY_URLS:
         return UtilsCache._NIGTHLY_URLS[url]
     else:
         try:
             with urllib.request.urlopen(url, timeout = timeout) as fh:
                 data = str(fh.read(), "UTF-8")
                 vers = re.findall( pattern , data)
                 if not vers:
                     print(data)
                     raise Exception("Pattern %s does not match." % pattern)
                 UtilsCache._NIGTHLY_URLS[url] = vers
                 return vers
         except Exception as e:
             EmergeDebug.warning("Nightly builds unavailable for %s: %s" % (url, e))
             return [None]
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:28,代码来源:utils.py


示例2: notify

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import info [as 别名]
def notify(title,message,alertClass = None):
    EmergeDebug.info("%s: %s" % (title, message))
    backends = emergeSettings.get( "General","EMERGE_USE_NOTIFY", "")
    if backends == "":
        return
    backends = Notifier.NotificationLoader.load(backends.split(";"))
    for backend in backends.values():
        backend.notify(title,message,alertClass)
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:10,代码来源:utils.py


示例3: handlePackage

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import info [as 别名]
def handlePackage( category, packageName, buildAction, continueFlag, skipUpToDateVcs ):
    EmergeDebug.debug_line()
    EmergeDebug.info("Handling package: %s, action: %s" % (packageName, buildAction))

    success = True
    package = portage.getPackageInstance( category, packageName )
    if package is None:
        raise portage.PortageException( "Package not found", category, packageName )

    if buildAction in [ "all", "full-package", "update", "update-all" ]:
        success = success and doExec( package, "fetch", continueFlag )
        if success and skipUpToDateVcs and package.subinfo.hasSvnTarget( ):
            revision = package.sourceVersion( )
            for p in InstallDB.installdb.getInstalledPackages( category, packageName ):
                if p.getRevision( ) == revision:
                    EmergeDebug.info("Skipping further actions, package is up-to-date")
                    return True

        success = success and doExec( package, "unpack", continueFlag )
        success = success and doExec( package, "compile" )
        success = success and doExec( package, "cleanimage" )
        success = success and doExec( package, "install" )
        if buildAction in [ "all", "update", "update-all" ]:
            success = success and doExec( package, "qmerge" )
        if buildAction == "full-package":
            success = success and doExec( package, "package" )
        success = success or continueFlag
    elif buildAction in [ "fetch", "unpack", "configure", "compile", "make", "checkdigest",
                          "dumpdeps", "test",
                          "package", "unmerge", "cleanimage", "cleanbuild", "createpatch",
                          "geturls",
                          "print-revision",
                          "print-files"
                        ]:
        success = doExec( package, buildAction, continueFlag )
    elif buildAction == "install":
        success = doExec( package, "cleanimage" )
        success = success and doExec( package, "install", continueFlag )
    elif buildAction == "qmerge":
        #success = doExec( package, "cleanimage" )
        #success = success and doExec( package, "install")
        success = success and doExec( package, "qmerge" )
    elif buildAction == "generate-jenkins-job":
        success = jenkins.generateJob(package)
    elif buildAction == "print-source-version":
        print( "%s-%s" % ( packageName, package.sourceVersion( ) ) )
        success = True
    elif buildAction == "print-package-version":
        print( "%s-%s-%s" % ( packageName, compiler.getCompilerName( ), package.sourceVersion( ) ) )
        success = True
    elif buildAction == "print-targets":
        portage.printTargets( category, packageName )
        success = True
    else:
        success = EmergeDebug.error("could not understand this buildAction: %s" % buildAction)

    return success
开发者ID:TheOneRing,项目名称:emerge,代码行数:59,代码来源:emerge.py


示例4: __exit__

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import info [as 别名]
 def __exit__(self, exc_type, exc_val, exc_tb):
     self.stop()
     if EmergeConfig.emergeSettings.getboolean( "EmergeDebug", "MeasureTime", False ):
         EmergeDebug.info( "Task: %s stopped after: %s" % (self.name , self))
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:6,代码来源:EmergeTimer.py


示例5: doExec

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import info [as 别名]
def doExec( package, action, continueFlag = False ):
    utils.startTimer( "%s for %s" % ( action, package ), 1 )
    EmergeDebug.info("Action: %s for %s" % (action, package))
    ret = package.execute( action )
    utils.stopTimer( "%s for %s" % ( action, package ) )
    return ret or continueFlag
开发者ID:TheOneRing,项目名称:emerge,代码行数:8,代码来源:emerge.py


示例6: execute

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import info [as 别名]
 def execute(self, path, cmd, args="", out=sys.stdout, err=sys.stderr):
     command = "%s --login -c \"export %s && cd %s && %s %s\"" % \
               ( self._sh, self._environmentSetup(), self.toNativePath( path ), self.toNativePath( cmd ), args )
     EmergeDebug.info("msys execute: %s" % command)
     return utils.system( command, stdout=out, stderr=err )
开发者ID:TheOneRing,项目名称:emerge,代码行数:7,代码来源:shells.py



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