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


Python EmergeDebug.debug方法代码示例

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


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

示例1: PackagerFactory

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
def PackagerFactory(parent, packagerType):
    """provides multi packager type api
    return PackagerBase derived instance for recent settings"""
    EmergeDebug.debug("PackagerFactory called", 2)
    packagers = []

    if packagerType:
        for packagerClass in packagerType:
            if not issubclass(packagerClass, PackagerBase):
                EmergeDebug.die("PackagerFactory: unsupported packager %s" % packagerClass)
            else:
                packager = packagerClass()
                init(packager, parent)
                packagers.append(packager)
    else:
        # automatic detection
        packager = InnoSetupPackager()
        init(packager, parent)

        if packager.configFile() != None:
            packagers.append(packager)

        # default packager
        if len(packagers) == 0:
            packager = KDEWinPackager()
            init(packager, parent)
            packagers.append(packager)
    return packagers
开发者ID:TheOneRing,项目名称:emerge,代码行数:30,代码来源:PackagerFactory.py

示例2: __getImageDirectories

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
    def __getImageDirectories( self ):
        """ return the image directories where the files are stored """
        imageDirs = []
        runtimeDependencies = portage.getDependencies(self.category, self.package)

        depList = []
        for ( category, package, _, _ ) in runtimeDependencies:
            # we only want runtime dependencies since we want to build a binary installer
            portage.solveDependencies(category, package, depList = depList,
                                      depType = DependencyType.Runtime, ignoredPackages = self.ignoredPackages)
        depList.reverse()

        # make sure current package is added to the list, too
        if not self.package.endswith("-package"):
            depList.append(DependencyPackage(self.category, self.package))

        for x in depList:
            if portage.PortageInstance.isVirtualPackage(x.category, x.package):
                EmergeDebug.debug("Ignoring package b/c it is virtual: %s/%s" % (x.category, x.package))
                continue

            _package = portage.getPackageInstance( x.category, x.package )

            imageDirs.append(( os.path.join( self.rootdir, "build", x.category, x.package,
                    self.__imageDirPattern( _package, _package.buildTarget )), _package.subinfo.options.merge.destinationPath , _package.subinfo.options.package.disableStriping ) )
            # this loop collects the files from all image directories
            EmergeDebug.debug("__getImageDirectories: category: %s, package: %s, version: %s, defaultTarget: %s" % (_package.category, x.package, _package.version, _package.buildTarget), 2)

        if emergeSettings.getboolean("QtSDK", "Enabled", "false"):
            imageDirs.append((os.path.join( emergeSettings.get("QtSDK", "Path") , emergeSettings.get("QtSDK", "Version"), emergeSettings.get("QtSDK", "Compiler")), None, False))

        return imageDirs
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:34,代码来源:CollectionPackagerBase.py

示例3: __fetchSingleBranch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [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

示例4: _defaulVersions

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
    def _defaulVersions( self ):
        if self.__defaulVersions is None:
            name = self.subinfo.parent.filename
            if name in VersionInfo._VERSION_INFOS_HINTS:
                if VersionInfo._VERSION_INFOS_HINTS[ name ] == None:
                    return None
                else:
                    #utils.debug("Using cached version info for %s in %s" % (name, _VERSION_INFOS_HINTS[ name ]))
                    return VersionInfo._VERSION_INFOS[ VersionInfo._VERSION_INFOS_HINTS[ name ] ]
            root = os.path.dirname( name )

            if self._fileName is None:
                possibleInis= [ os.path.join( root, "version.ini" ), os.path.join( root, "..", "version.ini" ),
                         os.path.join( root, "..", "..", "version.ini" ) ]
            else:
                possibleInis = [self._fileName]

            for iniPath in possibleInis:
                iniPath = os.path.abspath( iniPath )
                if iniPath in VersionInfo._VERSION_INFOS.keys( ):
                    VersionInfo._VERSION_INFOS_HINTS[ name ] = iniPath
                    EmergeDebug.debug("Found a version info for %s in cache" % name, 2)
                    return VersionInfo._VERSION_INFOS[ iniPath ]
                elif os.path.exists( iniPath ):
                    config = configparser.ConfigParser( )
                    config.read( iniPath )
                    VersionInfo._VERSION_INFOS[ iniPath ] = config
                    VersionInfo._VERSION_INFOS_HINTS[ name ] = iniPath
                    EmergeDebug.debug("Found a version info for %s in %s" % (name, iniPath), 2)
                    return config
            VersionInfo._VERSION_INFOS_HINTS[ name ] = None
        return self.__defaulVersions
开发者ID:TheOneRing,项目名称:emerge,代码行数:34,代码来源:VersionInfo.py

示例5: _fixCmakeImageDir

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
 def _fixCmakeImageDir(self, imagedir, rootdir ):
     """
     when using DESTDIR=foo under windows, it does not _replace_
     CMAKE_INSTALL_PREFIX with it, but prepends destdir to it.
     so when we want to be able to install imagedir into KDEROOT,
     we have to move things around...
     """
     EmergeDebug.debug("fixImageDir: %s %s" % (imagedir, rootdir), 1)
     # imagedir = e:\foo\thirdroot\tmp\dbus-0\image
     # rootdir  = e:\foo\thirdroot
     # files are installed to
     # e:\foo\thirdroot\tmp\dbus-0\image\foo\thirdroot
     _, rootpath = os.path.splitdrive( rootdir )
     #print "rp:", rootpath
     if ( rootpath.startswith( os.path.sep ) ):
         rootpath = rootpath[1:]
     # CMAKE_INSTALL_PREFIX = X:\
     # -> files are installed to
     # x:\build\foo\dbus\image\
     # --> all fine in this case
     #print("rp:", rootpath)
     if len(rootpath) == 0:
         return
     
     tmp = os.path.join( imagedir, rootpath )
     EmergeDebug.debug("tmp: %s" % tmp, 1)
     tmpdir = os.path.join( imagedir, "tMpDiR" )
     if ( not os.path.isdir( tmpdir ) ):
         os.mkdir( tmpdir )
     utils.moveEntries( tmp, tmpdir )
     os.chdir( imagedir )
     os.removedirs( rootpath )
     utils.moveEntries( tmpdir, imagedir )
     utils.cleanDirectory( tmpdir )
     os.rmdir( tmpdir )
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:37,代码来源:CMakeBuildSystem.py

示例6: getDependencies

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
def getDependencies( category, package, runtimeOnly = False ):
    """returns the dependencies of this package as list of strings:
    category/package"""

    subpackage, package = getSubPackage( category, package )
    if subpackage:
        EmergeDebug.debug("solving package %s/%s/%s %s" % (category, subpackage, package,
                                                           getFilename( category, package )))
    else:
        EmergeDebug.debug("solving package %s/%s %s" % (category, package, getFilename(category, package)))
        subpackage = package

    deps = []
    for pkg in [ subpackage ]:
        info = _getSubinfo(category, pkg)
        if not info is None:
            depDict = info.dependencies
            depDict.update( info.runtimeDependencies )
            if not runtimeOnly:
                depDict.update( info.buildDependencies )

            for line in list(depDict.keys()):
                (category, package) = line.split( "/" )
                version = PortageInstance.getNewestVersion( category, package )
                deps.append( [ category, package, version, depDict[ line ] ] )
    return deps
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:28,代码来源:portage.py

示例7: getPackageInstance

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
 def getPackageInstance(self, category, package):
     """return instance of class Package from package file"""
     fileName =  getFilename( category, package )
     pack = None
     mod = None
     if fileName.endswith(".py") and os.path.isfile(fileName):
         if not fileName in self._packageDict:
             EmergeDebug.debug("module to import: %s" % fileName, 2)
             if not os.path.isfile( fileName ):
                 try:
                     mod = builtins.__import__( fileName )
                 except ImportError as e:
                     EmergeDebug.warning('import failed for module %s: %s' % (fileName, str(e)))
                     mod =  None
             else:
                 modulename = os.path.basename( fileName )[:-3].replace('.', '_')
                 loader = importlib.machinery.SourceFileLoader(modulename, fileName)
                 try:
                     mod = loader.load_module()
                 except Exception as e:
                     raise PortageException("Failed to load file %s" % fileName, category, package, e)
             if not mod is None:
                 subpackage, package = getSubPackage( category, package )
                 self._CURRENT_MODULE  = ( fileName, category,subpackage, package, mod )
                 pack = mod.Package( )
                 self._packageDict[ fileName ] = pack
             else:
                 raise PortageException("Failed to find package", category, package)
         else:
             pack = self._packageDict[ fileName ]
         return pack
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:33,代码来源:portage.py

示例8: __init__

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
 def __init__(self):
     EmergeDebug.debug("SetupPackageBase.__init__ called", 2)
     PackageBase.__init__(self)
     MultiSource.__init__(self)
     BuildSystemBase.__init__(self)
     PackagerBase.__init__(self)
     self.subinfo.options.unpack.runInstaller = True
开发者ID:TheOneRing,项目名称:emerge,代码行数:9,代码来源:SetupPackageBase.py

示例9: cleanBuild

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
    def cleanBuild( self ):
        """cleanup currently used build dir"""
        if os.path.exists( self.buildDir() ):
            utils.cleanDirectory( self.buildDir() )
            EmergeDebug.debug("cleaning build dir: %s" % self.buildDir(), 1)

        return True
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:9,代码来源:PackageBase.py

示例10: deleteFile

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
def deleteFile(fileName):
    """delete file """
    if not os.path.exists( fileName ):
        return False
    EmergeDebug.debug("delete file %s " % (fileName), 2)
    os.remove( fileName )
    return True
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:9,代码来源:utils.py

示例11: unpack

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
    def unpack(self):
        """unpacking all zipped(gz, zip, bz2) tarballs"""
        EmergeDebug.debug("ArchiveSource.unpack called", 2)

        filenames = self.localFileNames()

        # TODO: this might delete generated patches
        utils.cleanDirectory(self.workDir())

        if not self.checkDigest():
            return False

        binEndings = (".exe", ".bat", ".msi")
        for filename in filenames:
            if filename.endswith(binEndings):
                filePath = os.path.abspath( os.path.join(EmergeStandardDirs.downloadDir(), filename) )
                if self.subinfo.options.unpack.runInstaller:
                    _, ext = os.path.splitext( filename )
                    if ext == ".exe":
                        return utils.system("%s" % filePath )
                    elif ( ext == ".msi" ):
                        return utils.system("msiexec /package %s" % filePath )
                if not utils.copyFile( filePath, os.path.join(self.workDir(), filename) ):
                    return False
            else:
                if not utils.unpackFile( EmergeStandardDirs.downloadDir(), filename, self.workDir()):
                    return False

        ret = self.applyPatches()
        if emergeSettings.getboolean("General","EMERGE_HOLD_ON_PATCH_FAIL",False):
            return ret
        return True
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:34,代码来源:ArchiveSource.py

示例12: fetch

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
    def fetch( self, dummyRepopath = None ):
        """fetch normal tarballs"""
        EmergeDebug.debug("ArchiveSource.fetch called", 2)

        filenames = self.localFileNames()

        if ( self.noFetch ):
            EmergeDebug.debug("skipping fetch (--offline)")
            return True

        self.setProxy()
        if self.subinfo.hasTarget():
            if self.__checkFilesPresent(filenames):
                EmergeDebug.debug("files and digests available, no need to download files", 1)
                return True

            result = utils.getFiles( self.subinfo.target(), EmergeStandardDirs.downloadDir() , filenames = self.subinfo.archiveName() )
            if not result:
                EmergeDebug.debug("failed to download files", 1)
                return False
            if result and self.subinfo.hasTargetDigestUrls():
                if type(self.subinfo.targetDigestUrl()) == tuple:
                    url, alg = self.subinfo.targetDigestUrl()
                    return utils.getFiles(url, EmergeStandardDirs.downloadDir(),
                                          filenames = self.subinfo.archiveName()
                                                        + EmergeHash.HashAlgorithm.fileEndings().get(alg))
                else:
                    return utils.getFiles( self.subinfo.targetDigestUrl(), EmergeStandardDirs.downloadDir(), filenames = '' )
            else:
                EmergeDebug.debug("no digestUrls present", 2)
                return True
        else:
            return utils.getFiles( "", EmergeStandardDirs.downloadDir() )
开发者ID:TheOneRing,项目名称:emerge,代码行数:35,代码来源:ArchiveSource.py

示例13: getFiles

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
def getFiles( urls, destdir, suffix='' , filenames = ''):
    """download files from 'url' into 'destdir'"""
    EmergeDebug.debug("getfiles called. urls: %s, filenames: %s, suffix: %s" % (urls, filenames, suffix), 1)
    # make sure distfiles dir exists
    if ( not os.path.exists( destdir ) ):
        os.makedirs( destdir )

    if type(urls) == list:
        urlList = urls
    else:
        urlList = urls.split()

    if filenames == '':
        filenames = [ os.path.basename(x) for x in urlList ]

    if type(filenames) == list:
        filenameList = filenames
    else:
        filenameList = filenames.split()
        
    dlist = list(zip( urlList , filenameList ))
    
    for url,filename in dlist:
        if ( not getFile( url + suffix, destdir , filename ) ):
            return False

    return True
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:29,代码来源:utils.py

示例14: getFile

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
def getFile( url, destdir , filename='' ):
    """download file from 'url' into 'destdir'"""
    EmergeDebug.debug("getFile called. url: %s" % url, 1)
    if url == "":
        EmergeDebug.error("fetch: no url given")
        return False

    if UtilsCache.findApplication("wget"):
        return wgetFile( url, destdir , filename )


    if not filename:
        _, _, path, _, _, _ = urllib.parse.urlparse( url )
        filename = os.path.basename( path )

    if os.path.exists(os.path.join( destdir, filename )):
        return True

    width, _ =  shutil.get_terminal_size((80,20))
    def dlProgress(count, blockSize, totalSize):
        percent = int(count * blockSize * 100 / totalSize)
        times = int((width - 20)/100 * percent)
        sys.stdout.write(("\r%s%3d%%" % ("#" * times, percent)))
        sys.stdout.flush()

    urllib.request.urlretrieve(url, filename =  os.path.join( destdir, filename ), reporthook= dlProgress if EmergeDebug.verbose() >= 0 else None )

    if EmergeDebug.verbose()>=0:
        sys.stdout.write("\n")
        sys.stdout.flush()
    return True
开发者ID:pgquiles,项目名称:kdewindows-emerge,代码行数:33,代码来源:utils.py

示例15: renameDir

# 需要导入模块: import EmergeDebug [as 别名]
# 或者: from EmergeDebug import debug [as 别名]
def renameDir(src, dest):
    """ rename a directory """
    EmergeDebug.debug("rename directory from %s to %s" % (src, dest), 2)
    if os.rename( src, dest ) == 0:
        return False
    else:
        return True
开发者ID:TheOneRing,项目名称:emerge,代码行数:9,代码来源:utils.py


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