pygccxml.utils package

Overview

defines logger classes and few convenience methods, not related to the declarations tree

pygccxml.utils.cached
Convert a method into a cached attribute
pygccxml.utils.contains_parent_dir(fpath, dirs)
returns bool( filter( lambda dir: fpath.startswith( dir ), dirs ) ) precondition: dirs and fpath should be normalize_path’ed before calling this function
pygccxml.utils.create_temp_file_name(suffix, prefix=None, dir=None)

small convenience function that creates temporal file.

This function is a wrapper aroung Python built-in function - tempfile.mkstemp

class pygccxml.utils.enum

Bases: object

Usage example:

class fruits(enum):
    apple = 0
    orange = 1

fruits.has_value( 1 )
fruits.name_of( 1 )
classmethod has_value(enum_numeric_value)
classmethod name_of(enum_numeric_value)
pygccxml.utils.get_architecture()

returns computer architecture: 32 or 64.

The guess is based on maxint.

class pygccxml.utils.loggers

class-namespace, defines few loggers classes, used in the project

all
contains all logger classes, defined by the class
cxx_parser

logger for C++ parser functionality

If you set this logger level to DEBUG, you will be able to see the exact command line, used to invoke GCC-XML and errors that occures during XML parsing

declarations_cache

logger for declarations tree cache functionality

If you set this logger level to DEBUG, you will be able to see what is exactly happens, when you read the declarations from cache file. You will be able to decide, whether it worse for you to use this or that cache strategy.

pdb_reader
logger for MS .pdb file reader functionality
queries_engine

logger for query engine functionality.

If you set this logger level to DEBUG, you will be able to see what queries you do against declarations tree, measure performance and may be even to improve it. Query engine reports queries and whether they are optimized or not.

root
root logger exists for your convenience only
class pygccxml.utils.native_compiler

provides information about the compiler, which was used to build the Python executable

static get_gccxml_compiler()
static get_version()
pygccxml.utils.normalize_path(some_path)
return os.path.normpath( os.path.normcase( some_path ) )
pygccxml.utils.remove_file_no_raise(file_name)
removes file from disk, if exception is raised, it silently ignores it

Modules

fs_utils

defines few classes, that simplifies a file system entries iteration

class pygccxml.utils.fs_utils.base_files_iterator(file_exts, is_include_exts=True)
next()
restart()
class pygccxml.utils.fs_utils.directories_walker(directories, is_recursive=1)
next()
restart()
class pygccxml.utils.fs_utils.files_walker(directories, file_ext_filter='', is_include_filter=True, is_recursive=True)

Bases: pygccxml.utils.fs_utils.base_files_iterator

next()
restart()
blog comments powered by Disqus

Table Of Contents

Previous topic

pygccxml.binary_parsers API

Next topic

Py++ package

This Page