Package pyplusplus :: Package module_builder :: Module builder

# Source Code for Module pyplusplus.module_builder.builder

      1  # Copyright 2004-2008 Roman Yakovenko.
      2  # Distributed under the Boost Software License, Version 1.0. (See
      3  # accompanying file LICENSE_1_0.txt or copy at
      4  # http://www.boost.org/LICENSE_1_0.txt)
      5
      6  import os
      7  import sys
      8  import time
      9  import types
     10  import warnings
     11
     12  from pygccxml import parser
     13  from pygccxml import declarations as decls_package
     14
     15  from pyplusplus import utils
     16  from pyplusplus import _logging_
     17  from pyplusplus import decl_wrappers
     18  from pyplusplus import file_writers
     19  from pyplusplus import code_creators
     20  from pyplusplus import module_creator as mcreator_package
     21
     22 -class module_builder_t(object):
     23      """
     24      This class provides users with simple and intuitive interface to Py++
     25      and/or pygccxml functionality. If this is your first attempt to use Py++
     26      consider to read tutorials. You can find them on U{web site<http://www.language-binding.net>}.
     27      """
     28
     29 -    def __init__( self
     30                    , files
     31                    , gccxml_path=''
     32                    , working_directory='.'
     33                    , include_paths=None
     34                    , define_symbols=None
     35                    , undefine_symbols=None
     36                    , start_with_declarations=None
     37                    , compilation_mode=None
     38                    , cache=None
     39                    , optimize_queries=True
     40                    , ignore_gccxml_output=False
     41                    , indexing_suite_version=1
     42                    , cflags=""
     43                    , encoding='ascii'
     44                    , compiler=None):
     45          """
     46          @param files: list of files, declarations from them you want to export
     47          @type files: list of strings or L{file_configuration_t} instances
     48
     49          @param gccxml_path: path to gccxml binary. If you don't pass this argument,
     50          pygccxml parser will try to locate it using you environment PATH variable
     51          @type gccxml_path: str
     52
     53          @param include_paths: additional header files location. You don't have to
     54          specify system and standard directories.
     55          @type include_paths: list of strings
     56
     57          @param define_symbols: list of symbols to be defined for preprocessor.
     58          @param define_symbols: list of strings
     59
     60          @param undefine_symbols: list of symbols to be undefined for preprocessor.
     61          @param undefine_symbols: list of strings
     62
     63          @param cflags: Raw string to be added to gccxml command line.
     64          """
     65          object.__init__( self )
     66          self.logger = _logging_.loggers.module_builder
     67          self.__encoding = encoding
     68          gccxml_config = parser.config_t(
     69              gccxml_path=gccxml_path
     70              , working_directory=working_directory
     71              , include_paths=include_paths
     72              , define_symbols=define_symbols
     73              , undefine_symbols=undefine_symbols
     74              , start_with_declarations=start_with_declarations
     75              , ignore_gccxml_output=ignore_gccxml_output
     76              , cflags=cflags
     77              , compiler=compiler)
     78
     79          #may be in future I will add those directories to user_defined_directories
     80          #to self.__code_creator.
     81          self.__working_dir = os.path.abspath( working_directory )
     82
     83          self.__parsed_files = map( decls_package.filtering.normalize_path
     84                                     , parser.project_reader_t.get_os_file_names( files ) )
     85          tmp = map( lambda file_: os.path.split( file_ )[0], self.__parsed_files )
     86          self.__parsed_dirs = filter( None, tmp )
     87
     88          self.__global_ns = self.__parse_declarations( files
     89                                                        , gccxml_config
     90                                                        , compilation_mode
     91                                                        , cache
     92                                                        , indexing_suite_version)
     93          self.__code_creator = None
     94          if optimize_queries:
     95              self.run_query_optimizer()
     96
     97          self.__declarations_code_head = []
     98          self.__declarations_code_tail = []
     99
    100          self.__registrations_code_head = []
    101          self.__registrations_code_tail = []
    102
    103      @property
    104 -    def global_ns( self ):
    105          """reference to global namespace"""
    106          return self.__global_ns
    107
    108      @property
    109 -    def encoding( self ):
    110          return self.__encoding
    111
    112 -    def register_module_dependency( self, other_module_generated_code_dir ):
    113          """``already_exposed`` solution is pretty good when you mix hand-written
    114          modules with Py++ generated. It doesn't work/scale for "true"
    115          multi-module development. This is exactly the reason why ``Py++``_
    116          offers "semi automatic" solution.
    117
    118          For every exposed module, ``Py++``_ generates "exposed_decl.pypp.txt" file.
    119          This file contains the list of all parsed declarations and whether they
    120          were included or excluded. Later, when you work on another module, you
    121          can tell ``Py++``_ that the current module depends on the previously
    122          generated one. ``Py++``_ will load "exposed_decl.pypp.txt" file and
    123          update the declarations.
    124          """
    125
    126          db = utils.exposed_decls_db_t()
    127          db.load( other_module_generated_code_dir )
    128          db.update_decls( self.global_ns )
    129
    130 -    def run_query_optimizer(self):
    131          """
    132          It is possible to optimze time that takes to execute queries. In most cases
    133          this is done from __init__ method. But there are use-case, when you need
    134          to disable optimizer at __init__ and run it later.
    135          """
    136          self.__global_ns.init_optimizer()
    137
    138 -    def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ):
    139          if None is gccxml_config:
    140              gccxml_config = parser.config_t()
    141          if None is compilation_mode:
    142              compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE
    143          start_time = time.clock()
    144          self.logger.debug( 'parsing files - started' )
    145          reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() )
    146          decls = reader.read_files( files, compilation_mode )
    147
    148          self.logger.debug( 'parsing files - done( %f seconds )' % ( time.clock() - start_time ) )
    149          self.logger.debug( 'settings declarations defaults - started' )
    150
    151          global_ns = decls_package.matcher.get_single(
    152                  decls_package.namespace_matcher_t( name='::' )
    153                  , decls )
    154          if indexing_suite_version != 1:
    155              for cls in global_ns.classes():
    156                  cls.indexing_suite_version = indexing_suite_version
    157              for cls in global_ns.decls(decl_type=decls_package.class_declaration_t):
    158                  cls.indexing_suite_version = indexing_suite_version
    159
    160          start_time = time.clock()
    161          self.__apply_decls_defaults(decls)
    162          self.logger.debug( 'settings declarations defaults - done( %f seconds )'
    163                             % ( time.clock() - start_time ) )
    164          return global_ns
    165
    166 -    def __filter_by_location( self, flatten_decls ):
    167          for decl in flatten_decls:
    168              if not decl.location:
    169                  continue
    170              fpath = decls_package.filtering.normalize_path( decl.location.file_name )
    171              if decls_package.filtering.contains_parent_dir( fpath, self.__parsed_dirs ):
    172                  continue
    173              if fpath in self.__parsed_files:
    174                  continue
    175              found = False
    176              for pfile in self.__parsed_files:
    177                  if fpath.endswith( pfile ):
    178                      found = True
    179                      break
    180              if not found:
    181                  decl.exclude()
    182
    183 -    def __apply_decls_defaults(self, decls):
    184          flatten_decls = decls_package.make_flatten( decls )
    185          self.__filter_by_location( flatten_decls )
    186          call_policies_resolver = mcreator_package.built_in_resolver_t()
    187          calldefs = filter( lambda decl: isinstance( decl, decls_package.calldef_t )
    188                             , flatten_decls )
    189          map( lambda calldef: calldef.set_call_policies( call_policies_resolver( calldef ) )
    190               , calldefs )
    191          mem_vars = filter( lambda decl: isinstance( decl, decls_package.variable_t )
    192                                          and isinstance( decl.parent, decls_package.class_t )
    193                             , flatten_decls )
    194          map( lambda mem_var: mem_var.set_getter_call_policies( call_policies_resolver( mem_var, 'get' ) )
    195               , mem_vars )
    196          map( lambda mem_var: mem_var.set_setter_call_policies( call_policies_resolver( mem_var, 'set' ) )
    197               , mem_vars )
    198
    199      @property
    200 -    def declarations_code_head( self ):
    201          "List of user code, that will be added to the head of the declarations section."
    202          return self.__declarations_code_head
    203
    204      @property
    205 -    def declarations_code_tail( self ):
    206          "List of user code, that will be added to the tail of the declarations section."
    207          return self.__declarations_code_tail
    208
    209      @property
    210 -    def registrations_code_head( self ):
    211          "List of user code, that will be added to the head of the registrations section."
    212          return self.__registrations_code_head
    213
    214      @property
    215 -    def registrations_code_tail( self ):
    216          "List of user code, that will be added to the tail of the registrations section."
    217          return self.__registrations_code_tail
    218
    219 -    def print_declarations(self, decl=None, detailed=True, recursive=True, writer=sys.stdout.write):
    220          """
    221          This function will print detailed description of all declarations or
    222          some specific one.
    223
    224          @param decl: optional, if passed, then only it will be printed
    225          @type decl: instance of L{decl_wrappers.decl_wrapper_t} class
    226          """
    227          if None is decl:
    228              decl = self.global_ns
    229          decl_wrappers.print_declarations( decl, detailed, recursive, writer )
    230
    231 -    def build_code_creator( self
    232                         , module_name
    233                         , boost_python_ns_name='bp'
    234                         , create_casting_constructor=True
    235                         , call_policies_resolver_=None
    236                         , types_db=None
    237                         , target_configuration=None
    238                         , enable_indexing_suite=True
    239                         , doc_extractor=None):
    240          """
    241          Creates L{module_t} code creator.
    242
    243          @param module_name: module name
    244          @type module_name: string
    245
    246          @param boost_python_ns_name: boost::python namespace alias, by default
    247          it is 'bp'
    248          @type boost_python_ns_name: string
    249
    250          @param call_policies_resolver_: callable, that will be invoked on every
    251          calldef object. It should return call policies.
    252          @type call_policies_resolver_: callable
    253          @param doc_extractor: callable, that takes as argument reference to declaration
    254              and returns documentation string
    255          @type doc_extractor: callable or None
    256          """
    257          if not create_casting_constructor:
    258              msg = os.linesep.join([
    259                        "create_casting_constructor argument is deprecated."
    260                      , "If want to disable boost::python::implicitly_convertible code generation, consider to use allow_implicit_conversion constructor property"
    261                      , ">>> mb = module_builder_t(...)"
    262                      , ">>> mb.constructors().allow_implicit_conversion = False"])
    263              warnings.warn(msg, DeprecationWarning, stacklevel=2)
    264
    265              self.global_ns.constructors(allow_empty=True).allow_implicit_conversion = False
    266
    267          creator = mcreator_package.creator_t( self.global_ns
    268                                                , module_name
    269                                                , boost_python_ns_name
    270                                                , call_policies_resolver_
    271                                                , types_db
    272                                                , target_configuration
    273                                                , enable_indexing_suite
    274                                                , doc_extractor)
    275          self.__code_creator = creator.create()
    276          self.__code_creator.replace_included_headers(self.__parsed_files)
    277          #I think I should ask users, what they expect
    278          #self.__code_creator.user_defined_directories.append( self.__working_dir )
    279          #map( self.__code_creator.user_defined_directories.append
    280          #     , self.__parsed_dirs )
    281
    282          return self.__code_creator
    283
    284      @property
    285 -    def code_creator( self ):
    286          "reference to L{code_creators.module_t} instance"
    287          if not self.__code_creator:
    288              raise RuntimeError( "self.module is equal to None. Did you forget to call build_code_creator function?" )
    289          return self.__code_creator
    290
    291 -    def has_code_creator( self ):
    292          """
    293          Function, that will return True if build_code_creator function has been
    294          called and False otherwise
    295          """
    296          return not ( None is self.__code_creator )
    297
    298 -    def add_declaration_code( self, code, tail=True ):
    299          if tail:
    300              self.__declarations_code_tail.append( code )
    301          else:
    302              self.__declarations_code_head.append( code )
    303
    304 -    def add_registration_code( self, code, tail=True ):
    305          if tail:
    306              self.__registrations_code_tail.append( code )
    307          else:
    308              self.__registrations_code_head.append( code )
    309
    310 -    def add_constants( self, **keywds ):
    311          """adds code that exposes some constants to Python.
    312
    313          For example:
    314              mb.add_constants( version='"1.2.3"' )
    315          or
    316              mb.add_constants( **{ version:'"1.2.3"' } )
    317          will generate next code:
    318              boost::python::scope().attr("version") = "1.2.3";
    319          """
    320          tmpl = 'boost::python::scope().attr("%(name)s") = %(value)s;'
    321          for name, value in keywds.items():
    322              if not isinstance( value, types.StringTypes ):
    323                  value = str( value )
    324              self.add_registration_code( tmpl % dict( name=name, value=value) )
    325
    326
    327 -    def __merge_user_code( self ):
    328          for code in self.__declarations_code_tail:
    329              self.code_creator.add_declaration_code( code, -1 )
    330
    331          for code in self.__declarations_code_head:
    332              self.code_creator.add_declaration_code( code, 0 )
    333
    334          body = self.code_creator.body
    335
    336          for code in self.__registrations_code_tail:
    337              body.adopt_creator( code_creators.custom_text_t( code ), -1 )
    338
    339          for code in self.__registrations_code_head:
    340              body.adopt_creator( code_creators.custom_text_t( code ), 0 )
    341
    342
    343 -    def write_module( self, file_name ):
    344          """
    345          Writes module to single file
    346          @param file_name: file name
    347          @type file_name: string
    348          """
    349          self.__merge_user_code()
    350          file_writers.write_file( self.code_creator, file_name, encoding=self.encoding )
    351
    352 -    def __work_on_unused_files( self, dir_name, written_files, on_unused_file_found ):
    353          all_files = os.listdir( dir_name )
    354          all_files = map( lambda fname: os.path.join( dir_name, fname ), all_files )
    355          all_files = filter( file_writers.has_pypp_extenstion, all_files )
    356
    357          unused_files = set( all_files ).difference( set( written_files ) )
    358          for fpath in unused_files:
    359              try:
    360                  if on_unused_file_found is os.remove:
    361                      self.logger.info( 'removing file "%s"' % fpath )
    362                  on_unused_file_found( fpath )
    363              except Exception, error:
    364                  self.logger.exception( "Exception was catched, while executing 'on_unused_file_found' function."  )
    365
    366 -    def split_module( self
    367                        , dir_name
    368                        , huge_classes=None
    369                        , on_unused_file_found=os.remove
    370                        , use_files_sum_repository=False):
    371          """
    372          Writes module to multiple files
    373
    374          @param dir_name: directory name
    375          @type dir_name: string
    376
    377          @param huge_classes: list that contains reference to classes, that should be split
    378
    379          @param on_unused_file_found: callable object that represents the action that should be taken on
    380                                       file, which is no more in use
    381
    382          @use_files_sum_repository: Py++ can generate file, which will contain md5 sum of every generated file.
    383                                     Next time you generate code, md5sum will be loaded from the file and compared.
    384                                     This could speed-up code generation process by 10-15%.
    385          """
    386          self.__merge_user_code()
    387
    388          files_sum_repository = None
    389          if use_files_sum_repository:
    390              cache_file = os.path.join( dir_name, self.code_creator.body.name + '.md5.sum' )
    391              files_sum_repository = file_writers.cached_repository_t( cache_file )
    392
    393          written_files = []
    394          if None is huge_classes:
    395              written_files = file_writers.write_multiple_files(
    396                                  self.code_creator
    397                                  , dir_name
    398                                  , files_sum_repository=files_sum_repository
    399                                  , encoding=self.encoding)
    400          else:
    401              written_files = file_writers.write_class_multiple_files(
    402                                  self.code_creator
    403                                  , dir_name
    404                                  , huge_classes
    405                                  , files_sum_repository=files_sum_repository
    406                                  , encoding=self.encoding)
    407          self.__work_on_unused_files( dir_name, written_files, on_unused_file_found )
    408
    409          return written_files
    410
    411 -    def balanced_split_module( self
    412                                 , dir_name
    413                                 , number_of_files
    414                                 , on_unused_file_found=os.remove
    415                                 , use_files_sum_repository=False):
    416          """
    417          Writes module to fixed number of multiple cpp files
    418
    419          @param number_of_files: the desired number of generated cpp files
    420          @type number_of_files: int
    421
    422          @param dir_name: directory name
    423          @type dir_name: string
    424
    425          @param on_unused_file_found: callable object that represents the action that should be taken on
    426                                       file, which is no more in use
    427
    428          @use_files_sum_repository: Py++ can generate file, which will contain md5 sum of every generated file.
    429                                     Next time you generate code, md5sum will be loaded from the file and compared.
    430                                     This could speed-up code generation process by 10-15%.
    431          """
    432          self.__merge_user_code()
    433
    434          files_sum_repository = None
    435          if use_files_sum_repository:
    436              cache_file = os.path.join( dir_name, self.code_creator.body.name + '.md5.sum' )
    437              files_sum_repository = file_writers.cached_repository_t( cache_file )
    438
    439          written_files = file_writers.write_balanced_files( self.code_creator
    440                                                             , dir_name
    441                                                             , number_of_buckets=number_of_files
    442                                                             , files_sum_repository=files_sum_repository
    443                                                             , encoding=self.encoding)
    444
    445          self.__work_on_unused_files( dir_name, written_files, on_unused_file_found )
    446
    447          return written_files
    448
    449
    450      #select decl(s) interfaces
    451 -    def decl( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ):
    452          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    453          return self.global_ns.decl( name=name
    454                                      , function=function
    455                                      , header_dir=header_dir
    456                                      , header_file=header_file
    457                                      , recursive=recursive)
    458
    459 -    def decls( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ):
    460          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    461          return self.global_ns.decls( name=name
    462                                       , function=function
    463                                       , header_dir=header_dir
    464                                       , header_file=header_file
    465                                       , recursive=recursive)
    466
    467 -    def class_( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ):
    468          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    469          return self.global_ns.class_( name=name
    470                                        , function=function
    471                                        , header_dir=header_dir
    472                                        , header_file=header_file
    473                                        , recursive=recursive)
    474
    475 -    def classes( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ):
    476          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    477          return self.global_ns.classes( name=name
    478                                         , function=function
    479                                         , header_dir=header_dir
    480                                         , header_file=header_file
    481                                         , recursive=recursive)
    482
    483 -    def variable( self, name=None, function=None, type=None, header_dir=None, header_file=None, recursive=None ):
    484          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    485          return self.global_ns.variable( name=name
    486                                          , function=function
    487                                          , type=type
    488                                          , header_dir=header_dir
    489                                          , header_file=header_file
    490                                          , recursive=recursive)
    491      var = variable
    492
    493 -    def variables( self, name=None, function=None, type=None, header_dir=None, header_file=None, recursive=None ):
    494          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    495          return self.global_ns.variables( name=name
    496                                           , function=function
    497                                           , type=type
    498                                           , header_dir=header_dir
    499                                           , header_file=header_file
    500                                           , recursive=recursive)
    501      vars = variables
    502
    503 -    def calldef( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    504          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    505          return self.global_ns.calldef( name=name
    506                                         , function=function
    507                                         , return_type=return_type
    508                                         , arg_types=arg_types
    509                                         , header_dir=header_dir
    510                                         , header_file=header_file
    511                                         , recursive=recursive )
    512
    513 -    def calldefs( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    514          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    515          return self.global_ns.calldefs( name=name
    516                                          , function=function
    517                                          , return_type=return_type
    518                                          , arg_types=arg_types
    519                                          , header_dir=header_dir
    520                                          , header_file=header_file
    521                                          , recursive=recursive)
    522
    523 -    def operator( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None, recursive=None ):
    524          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    525          return self.global_ns.operator( name=name
    526                                          , symbol=symbol
    527                                          , decl_type=decl_type
    528                                          , return_type=return_type
    529                                          , arg_types=arg_types
    530                                          , header_dir=header_dir
    531                                          , header_file=header_file
    532                                          , recursive=recursive )
    533
    534 -    def operators( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None, recursive=None ):
    535          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    536          return self.global_ns.operators( name=name
    537                                           , symbol=symbol
    538                                           , decl_type=decl_type
    539                                           , return_type=return_type
    540                                           , arg_types=arg_types
    541                                           , header_dir=header_dir
    542                                           , header_file=header_file
    543                                           , recursive=recursive )
    544
    545 -    def member_function( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    546          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    547          return self.global_ns.member_function( name=name
    548                                                 , function=function
    549                                                 , return_type=return_type
    550                                                 , arg_types=arg_types
    551                                                 , header_dir=header_dir
    552                                                 , header_file=header_file
    553                                                 , recursive=recursive )
    554      mem_fun = member_function
    555
    556 -    def member_functions( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    557          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    558          return self.global_ns.member_functions( name=name
    559                                                  , function=function
    560                                                  , return_type=return_type
    561                                                  , arg_types=arg_types
    562                                                  , header_dir=header_dir
    563                                                  , header_file=header_file
    564                                                  , recursive=recursive)
    565
    566      mem_funs = member_functions
    567
    568 -    def constructor( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    569          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    570          return self.global_ns.constructor( name=name
    571                                             , function=function
    572                                             , return_type=return_type
    573                                             , arg_types=arg_types
    574                                             , header_dir=header_dir
    575                                             , header_file=header_file
    576                                             , recursive=recursive )
    577
    578 -    def constructors( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    579          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    580          return self.global_ns.constructors( name=name
    581                                              , function=function
    582                                              , return_type=return_type
    583                                              , arg_types=arg_types
    584                                              , header_dir=header_dir
    585                                              , header_file=header_file
    586                                              , recursive=recursive)
    587
    588 -    def member_operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    589          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    590          return self.global_ns.member_operator( name=name
    591                                                 , symbol=symbol
    592                                                 , function=function
    593                                                 , return_type=return_type
    594                                                 , arg_types=arg_types
    595                                                 , header_dir=header_dir
    596                                                 , header_file=header_file
    597                                                 , recursive=recursive )
    598
    599 -    def member_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    600          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    601          return self.global_ns.member_operators( name=name
    602                                                  , symbol=symbol
    603                                                  , function=function
    604                                                  , return_type=return_type
    605                                                  , arg_types=arg_types
    606                                                  , header_dir=header_dir
    607                                                  , header_file=header_file
    608                                                  , recursive=recursive )
    609
    610 -    def casting_operator( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    611          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    612          return self.global_ns.casting_operator( name=name
    613                                                  , function=function
    614                                                  , return_type=return_type
    615                                                  , arg_types=arg_types
    616                                                  , header_dir=header_dir
    617                                                  , header_file=header_file
    618                                                  , recursive=recursive )
    619
    620 -    def casting_operators( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    621          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    622          return self.global_ns.casting_operators( name=name
    623                                                   , function=function
    624                                                   , return_type=return_type
    625                                                   , arg_types=arg_types
    626                                                   , header_dir=header_dir
    627                                                   , header_file=header_file
    628                                                   , recursive=recursive)
    629
    630 -    def enumeration( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ):
    631          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    632          return self.global_ns.enumeration( name=name
    633                                             , function=function
    634                                             , header_dir=header_dir
    635                                             , header_file=header_file
    636                                             , recursive=recursive)
    637      enum = enumeration
    638
    639 -    def enumerations( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ):
    640          """Please see L{decl_wrappers.scopedef_t} class documentation"""
    641          return self.global_ns.enumerations( name=name
    642                                              , function=function
    643                                              , header_dir=header_dir
    644                                              , header_file=header_file
    645                                              , recursive=recursive)
    646
    647      enums = enumerations
    648
    649 -    def namespace( self, name=None, function=None, recursive=None ):
    650          """Please see L{decl_wrappers.namespace_t} class documentation"""
    651          return self.global_ns.namespace( name=name
    652                                           , function=function
    653                                           , recursive=recursive )
    654
    655 -    def namespaces( self, name=None, function=None, recursive=None ):
    656          """Please see L{decl_wrappers.namespace_t} class documentation"""
    657          return self.global_ns.namespaces( name=name
    658                                            , function=function
    659                                            , recursive=recursive )
    660
    661 -    def free_function( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    662          """Please see L{decl_wrappers.namespace_t} class documentation"""
    663          return self.global_ns.free_function( name=name
    664                                               , function=function
    665                                               , return_type=return_type
    666                                               , arg_types=arg_types
    667                                               , header_dir=header_dir
    668                                               , header_file=header_file
    669                                               , recursive=recursive )
    670      free_fun = free_function
    671
    672 -    def free_functions( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    673          """Please see L{decl_wrappers.namespace_t} class documentation"""
    674          return self.global_ns.free_functions( name=name
    675                                                , function=function
    676                                                , return_type=return_type
    677                                                , arg_types=arg_types
    678                                                , header_dir=header_dir
    679                                                , header_file=header_file
    680                                                , recursive=recursive)
    681      free_funs = free_functions
    682
    683 -    def free_operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    684          """Please see L{decl_wrappers.namespace_t} class documentation"""
    685          return self.global_ns.free_operator( name=name
    686                                               , symbol=symbol
    687                                               , function=function
    688                                               , return_type=return_type
    689                                               , arg_types=arg_types
    690                                               , header_dir=header_dir
    691                                               , header_file=header_file
    692                                               , recursive=recursive )
    693
    694 -    def free_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
    695          """Please see L{decl_wrappers.namespace_t} class documentation"""
    696          return self.global_ns.free_operators( name=name
    697                                                , symbol=symbol
    698                                                , function=function
    699                                                , return_type=return_type
    700                                                , arg_types=arg_types
    701                                                , header_dir=header_dir
    702                                                , header_file=header_file
    703                                                , recursive=recursive )
    704
    705 -    def _get_BOOST_PYTHON_MAX_ARITY( self ):
    706          return decl_wrappers.calldef_t.BOOST_PYTHON_MAX_ARITY
    707 -    def _set_BOOST_PYTHON_MAX_ARITY( self, value ):
    708          decl_wrappers.calldef_t.BOOST_PYTHON_MAX_ARITY = value
    709      BOOST_PYTHON_MAX_ARITY = property( _get_BOOST_PYTHON_MAX_ARITY, _set_BOOST_PYTHON_MAX_ARITY )
    710