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


Python EmergeDebug.trace方法代码示例

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

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

示例1: __fetchSingleBranch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
    def __fetchSingleBranch(self, repopath=None):
        EmergeDebug.trace("GitSource __fetchSingleBranch", 2)
        # get the path where the repositories should be stored to
        if repopath == None:
            repopath = self.repositoryUrl()
        EmergeDebug.debug("fetching %s" % repopath)

        # in case you need to move from a read only Url to a writeable one, here it gets replaced
        repopath = repopath.replace("[git]", "")
        repoString = utils.replaceVCSUrl(repopath)
        [repoUrl, repoBranch, repoTag] = utils.splitVCSUrl(repoString)
        if not repoBranch and not repoTag:
            repoBranch = "master"

        ret = True
        # only run if wanted (e.g. no --offline is given on the commandline)
        if not self.noFetch:
            self.setProxy()
            safePath = os.environ["PATH"]
            # add the git path to the PATH variable so that git can be called without path
            os.environ["PATH"] = os.path.join(self.rootdir, "git", "bin") + ";" + safePath
            checkoutDir = self.checkoutDir()
            # if we only have the checkoutdir but no .git within,
            # clean this up first
            if os.path.exists(checkoutDir) and not os.path.exists(checkoutDir + "\.git"):
                os.rmdir(checkoutDir)
            if os.path.exists(checkoutDir):
                if not repoTag:
                    self.__git("fetch")
                    ret = self.__git("checkout", repoBranch or "master") and self.__git("merge")
                    if self.subinfo.options.fetch.checkoutSubmodules:
                        self.__git("submodule update --init --recursive")
            else:
                # it doesn't exist so clone the repo
                os.makedirs(checkoutDir)
                # first try to replace with a repo url from etc/portage/emergehosts.conf
                recursive = "--recursive" if self.subinfo.options.fetch.checkoutSubmodules else ""
                ret = self.__git("clone", recursive, repoUrl, ".")

            # if a branch is given, we should check first if the branch is already downloaded
            # locally, otherwise we can track the remote branch
            if ret and repoBranch and not repoTag:
                track = ""
                if not self.__isLocalBranch(repoBranch):
                    track = "--track origin/"
                ret = self.__git("checkout", "%s%s" % (track, repoBranch))

            # we can have tags or revisions in repoTag
            if ret and repoTag:
                if self.__isTag(repoTag):
                    if not self.__isLocalBranch("_" + repoTag):
                        ret = self.__git("checkout", "-b", "_%s" % repoTag, repoTag)
                    else:
                        ret = self.__git("checkout", "_%s" % repoTag)
                else:
                    ret = self.__git("checkout", repoTag)

        else:
            EmergeDebug.debug("skipping git fetch (--offline)")
        return ret
开发者ID:TheOneRing,项目名称:emerge,代码行数:62,代码来源:GitSource.py


示例2: SourceFactory

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
def SourceFactory(settings):
    """ return sourceBase derived instance for recent settings"""
    EmergeDebug.trace("SourceFactory called", 1)
    source = None

    if settings.hasTarget():
        if settings.hasMultipleTargets():
            url = settings.targetAt(0)
        else:
            url = settings.target()
        source = ArchiveSource(settings)

    ## \todo move settings access into info class
    if settings.hasSvnTarget():
        url = settings.svnTarget()
        sourceType = utils.getVCSType( url )
        if sourceType == "svn":
            source = SvnSource(settings)
        elif sourceType == "hg":
            source = HgSource(settings)
        elif sourceType == "git":
            source = GitSource(settings)

    if source == None:
        EmergeDebug.die("none or unsupported source system set")
    if not source.subinfo:
        source.subinfo = settings
    source.url = url
    return source
开发者ID:TheOneRing,项目名称:emerge,代码行数:31,代码来源:SourceFactory.py


示例3: fetch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
    def fetch( self, repopath=None ):
        """try to clone or update the repository"""
        EmergeDebug.trace("HgSource.fetch called", 2)

        # get the path where the repositories should be stored to
        if repopath == None:
            repopath = self.repositoryUrl()

        # in case you need to move from a read only Url to a writeable one, here it gets replaced
#        repoString = utils.replaceVCSUrl( repopath )
        repopath = repopath.replace("[hg]", "")
        repoUrl, repoBranch, _ = utils.splitVCSUrl( repopath )
        ret = True

        # only run if wanted (e.g. no --offline is given on the commandline) or no hg support is given by the python installation
        if ( not self.noFetch and self.enableHg ):
            # question whether mercurial stuff uses these proxies
            self.setProxy()
            checkoutDir = self.checkoutDir()

            # check corrupted checkout dir
            if os.path.exists( checkoutDir ) and not os.path.exists( checkoutDir + "\.hg" ):
                os.rmdir( checkoutDir )
            
            if not os.path.exists( checkoutDir ):
                os.makedirs( checkoutDir )
                os.chdir( checkoutDir )
                ret = self.system( "%s clone %s ." % ( self.hgExecutable, repoUrl ) ) # TODO: check return code for success
            
            if os.path.exists( checkoutDir ):
                os.chdir( checkoutDir )
                ret = self.system( "%s update %s" % ( self.hgExecutable, repoBranch ) ) # TODO: check return code for success
        else:
            EmergeDebug.debug("skipping hg fetch (--offline)")
        return ret
开发者ID:TheOneRing,项目名称:emerge,代码行数:37,代码来源:HgSource.py


示例4: getPackagesCategories

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
def getPackagesCategories(packageName, defaultCategory = None):
    EmergeDebug.trace("getPackagesCategories for package name %s" % packageName)
    if defaultCategory is None:
        defaultCategory = emergeSettings.get("General","EMERGE_DEFAULTCATEGORY","kde")

    packageList, categoryList = [], []
    if len( packageName.split( "/" ) ) == 1:
        if PortageInstance.isCategory( packageName ):
            EmergeDebug.debug("isCategory=True", 2)
            packageList = PortageInstance.getAllPackages( packageName )
            categoryList = [ packageName ] * len(packageList)
        else:
            EmergeDebug.debug("isCategory=False", 2)
            if PortageInstance.isCategory( defaultCategory ) and PortageInstance.isPackage( defaultCategory, packageName ):
                # prefer the default category
                packageList = [ packageName ]
                categoryList = [ defaultCategory ]
            else:
                if PortageInstance.getCategory( packageName ):
                    packageList = [ packageName ]
                    categoryList = [ PortageInstance.getCategory( packageName ) ]
    elif len( packageName.split( "/" ) ) == 2:
        [ cat, pac ] = packageName.split( "/" )
        if PortageInstance.isCategory( cat ):
            categoryList = [ cat ]
        else:
            return packageList, categoryList
        if len( categoryList ) > 0 and PortageInstance.isPackage( categoryList[0], pac ):
            packageList = [ pac ]
        if len( categoryList ) and len( packageList ):
            EmergeDebug.debug("added package %s/%s" % (categoryList[0], pac), 2)
    else:
        EmergeDebug.error("unknown packageName")

    return packageList, categoryList
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:37,代码来源:portage.py


示例5: unpack

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def unpack(self):
     EmergeDebug.trace("MultiSource unpack", 2)
     # pylint: disable=E1101
     # multiple inheritance: MultiSource is never the only
     # superclass, others define self.buildSystemType.
     self.source.buildSystemType = self.buildSystemType
     return self.source.unpack()
开发者ID:TheOneRing,项目名称:emerge,代码行数:9,代码来源:MultiSource.py


示例6: __repositoryBaseUrl

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
    def __repositoryBaseUrl( self ):
        """ this function return the base url to the KDE repository """
        EmergeDebug.trace("VersionSystemSourceBase __repositoryBaseUrl", 2)
        # @todo move to SvnSource
        server = emergeSettings.get("General", "KDESVNSERVER", "svn://anonsvn.kde.org")


        return server + '/home/kde/'
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:10,代码来源:VersionSystemSourceBase.py


示例7: __init__

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def __init__(self, subinfo=None):
     EmergeDebug.trace("SvnSource.__init__", 2)
     if subinfo:
         self.subinfo = subinfo
     VersionSystemSourceBase.__init__( self )
     self.options = None
     ## \todo add internal dependency for subversion package
     self.svnInstallDir = os.path.join(self.rootdir, 'dev-utils', 'svn', 'bin')
开发者ID:TheOneRing,项目名称:emerge,代码行数:10,代码来源:SvnSource.py


示例8: applyPatch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def applyPatch(self, fileName, patchdepth, unusedSrcDir=None):
     """apply a patch to a mercurial repository checkout"""
     EmergeDebug.trace("HgSource.applyPatches called", 2)
     if fileName and self.enableHg:
         patchfile = os.path.join ( self.packageDir(), fileName )
         os.chdir( self.sourceDir() )
         return self.system( '"%s" import -p %s "%s"' % (self.hgExecutable, patchdepth, patchfile) )
     return True
开发者ID:TheOneRing,项目名称:emerge,代码行数:10,代码来源:HgSource.py


示例9: enterBuildDir

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
    def enterBuildDir(self):
        EmergeDebug.trace("EmergeBase.enterBuildDir called")

        if ( not os.path.exists( self.buildDir() ) ):
            os.makedirs( self.buildDir() )
            EmergeDebug.debug("creating: %s" % self.buildDir())

        os.chdir( self.buildDir() )
        EmergeDebug.debug("entering: %s" % self.buildDir())
开发者ID:TheOneRing,项目名称:emerge,代码行数:11,代码来源:EmergeBase.py


示例10: sourceDir

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
    def sourceDir(self, index=0 ):
        EmergeDebug.trace("VersionSystemSourceBase sourceDir", 2)
        sourcedir = self.checkoutDir( index )

        if self.subinfo.hasTargetSourcePath():
            sourcedir = os.path.join(sourcedir, self.subinfo.targetSourcePath())

        EmergeDebug.debug("using sourcedir: %s" % sourcedir, 2)
        return os.path.abspath(sourcedir)
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:11,代码来源:VersionSystemSourceBase.py


示例11: createPatch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def createPatch( self ):
     """create patch file from git source into the related package dir. The patch file is named autocreated.patch"""
     EmergeDebug.trace("HgSource.createPatch called", 2)
     ret = False
     if self.enableHg:
         os.chdir( self.sourceDir() )
         patchFile = os.path.join( self.packageDir(), "%s-%s.patch" % ( self.package, str( datetime.date.today() ).replace('-', '') ) )
         ret = self.system( self.sourceDir(), "%s diff > %s" % ( self.hgExecutable,  patchFile ) )
     return ret
开发者ID:TheOneRing,项目名称:emerge,代码行数:11,代码来源:HgSource.py


示例12: __init__

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def __init__(self):
     object.__init__(self)
     EmergeDebug.trace("MultiSource __init__", 2)
     # pylint: disable=E1101
     # multiple inheritance: MultiSource is never the only
     # superclass, others define self.source, self.subinfo etc.
     # TODO: This code should mostly be in the class defining self.source etc.
     self.source = SourceFactory(self.subinfo)
     self.source.localFileNames = self.localFileNames.__get__(self, MultiSource)
开发者ID:TheOneRing,项目名称:emerge,代码行数:11,代码来源:MultiSource.py


示例13: createPatch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def createPatch(self):
     """create patch file from git source into the related package dir.
     The patch file is named autocreated.patch"""
     EmergeDebug.trace("GitSource createPatch", 2)
     patchFileName = os.path.join(
         self.packageDir(), "%s-%s.patch" % (self.package, str(datetime.date.today()).replace("-", ""))
     )
     EmergeDebug.debug("git diff %s" % patchFileName, 1)
     with open(patchFileName, "wt+") as patchFile:
         return self.__git("diff", stdout=patchFile)
开发者ID:TheOneRing,项目名称:emerge,代码行数:12,代码来源:GitSource.py


示例14: repositoryUrlCount

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def repositoryUrlCount( self ):
     """return the number of provided repository url's. Multiple repository urls' are delimited by ';'"""
     EmergeDebug.trace("VersionSystemSourceBase repositoryUrlCount", 2)
     if not self.subinfo.hasSvnTarget():
         return 0
     u = self.subinfo.svnTarget()
     if u.find(';') == -1:
         return 1
     urls = u.split(';')
     return len(urls)
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:12,代码来源:VersionSystemSourceBase.py


示例15: repositoryUrlOptions

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import trace [as 别名]
 def repositoryUrlOptions( self, index=0 ):
     """this function return options for the repository url at position 'index'.
     Options for a repository url are defined by adding '#' followed by the specific option.
     """
     EmergeDebug.trace("VersionSystemSourceBase repositoryUrlOptions", 2)
     if self.subinfo.hasSvnTarget():
         u = self.getUrl(index)
         (dummy, option) = self.splitUrl(u)
         return option
     return None
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:12,代码来源:VersionSystemSourceBase.py



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