Update of /cvsroot/pygccxml/source/pyplusplus/code_creators
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/code_creators
Modified Files:
algorithm.py calldef.py class_declaration.py
declaration_based.py enum.py module.py smart_pointers.py
Log Message:
There are a lot of changes, sorry CVS did not worked for week or something like this
Changes
1. Lots of code clean up
2. Adding and updating documentation
3. Adding new method on decl_wrapper - readme. This method will return list of msgs to the developer.
For example if function takes by reference fundamental type it will say that this function could not be called from Python
4. Logging functionlity has been added to file writers too
5. Few bug fixes
6. For operator [] call policies is always set.
Index: module.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/module.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** module.py 16 Mar 2006 14:48:45 -0000 1.13
--- module.py 6 Apr 2006 06:15:58 -0000 1.14
***************
*** 105,109 ****
@rtype: int
"""
- first_include_index = 0
for i in range( len(self.creators) ):
if isinstance( self.creators[i], include.include_t ):
--- 105,108 ----
Index: algorithm.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/algorithm.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** algorithm.py 8 Mar 2006 09:32:52 -0000 1.15
--- algorithm.py 6 Apr 2006 06:15:58 -0000 1.16
***************
*** 12,16 ****
- import re
import types
import pygccxml
--- 12,15 ----
Index: class_declaration.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/class_declaration.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** class_declaration.py 20 Mar 2006 05:47:56 -0000 1.38
--- class_declaration.py 6 Apr 2006 06:15:58 -0000 1.39
***************
*** 16,20 ****
class class_t( scoped.scoped_t ):
! def __init__(self, class_inst, wrapper=None, held_type=None, parent=None ):
scoped.scoped_t.__init__( self
, parent=parent
--- 16,20 ----
class class_t( scoped.scoped_t ):
! def __init__(self, class_inst, wrapper=None, parent=None ):
scoped.scoped_t.__init__( self
, parent=parent
***************
*** 202,206 ****
def _generate_code_with_scope(self):
- cpptemplates = declarations.templates
result = []
scope_var_name = self.alias + '_scope'
--- 202,205 ----
Index: calldef.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/calldef.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** calldef.py 29 Mar 2006 04:11:55 -0000 1.50
--- calldef.py 6 Apr 2006 06:15:58 -0000 1.51
***************
*** 5,9 ****
import os
- import types
import algorithm
import declaration_based
--- 5,8 ----
***************
*** 367,371 ****
def _create_static_body(self):
! assert( self.declaration, declarations.member_function_t )
result = []
fptr_type_name = 'function_ptr_t'
--- 366,370 ----
def _create_static_body(self):
! assert isinstance( self.declaration, declarations.member_function_t )
result = []
fptr_type_name = 'function_ptr_t'
***************
*** 535,540 ****
if self.call_policies:
answer.append('[%s]' % self.call_policies.create( self ) )
! else:
! answer.append( '/*[ undefined call policies ]*/' )
return ''.join( answer )
--- 534,540 ----
if self.call_policies:
answer.append('[%s]' % self.call_policies.create( self ) )
! #I think it better not to print next line
! #else:
! # answer.append( '/*[ undefined call policies ]*/' )
return ''.join( answer )
***************
*** 694,699 ****
x = declarations.remove_cv( x )
other = algorithm.create_identifier( self, '::boost::python::other' )
! type = algorithm.create_identifier( self, x.decl_string )
! return declarations.templates.join( other, [ type ] ) + '()'
def _findout_self_position(self):
--- 694,699 ----
x = declarations.remove_cv( x )
other = algorithm.create_identifier( self, '::boost::python::other' )
! type_ = algorithm.create_identifier( self, x.decl_string )
! return declarations.templates.join( other, [ type_ ] ) + '()'
def _findout_self_position(self):
***************
*** 725,734 ****
if self_position == self.SELF_POSITION.FIRST:
answer[0] = self_identifier
! type = None
if len( self.declaration.arguments ) == 2:
! type = self.declaration.arguments[1].type
else:
! type = self.declaration.arguments[0].type
! answer[2] = self._call_type_constructor( type )
elif self_position == self.SELF_POSITION.SECOND:
answer[0] = self._call_type_constructor(self.declaration.arguments[0].type )
--- 725,734 ----
if self_position == self.SELF_POSITION.FIRST:
answer[0] = self_identifier
! type_ = None
if len( self.declaration.arguments ) == 2:
! type_ = self.declaration.arguments[1].type
else:
! type_ = self.declaration.arguments[0].type
! answer[2] = self._call_type_constructor( type_ )
elif self_position == self.SELF_POSITION.SECOND:
answer[0] = self._call_type_constructor(self.declaration.arguments[0].type )
***************
*** 772,776 ****
special_cases = {}
const_t = declarations.const_t
- reference_t = declarations.reference_t
pointer_t = declarations.pointer_t
for type_ in declarations.FUNDAMENTAL_TYPES.values():
--- 772,775 ----
Index: enum.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/enum.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** enum.py 28 Feb 2006 07:31:32 -0000 1.6
--- enum.py 6 Apr 2006 06:15:58 -0000 1.7
***************
*** 5,9 ****
import os
- import pygccxml
import algorithm
import declaration_based
--- 5,8 ----
Index: declaration_based.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/declaration_based.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** declaration_based.py 16 Mar 2006 14:48:45 -0000 1.11
--- declaration_based.py 6 Apr 2006 06:15:58 -0000 1.12
***************
*** 4,8 ****
# http://www.boost.org/LICENSE_1_0.txt)
- import pygccxml
import algorithm
import code_creator
--- 4,7 ----
Index: smart_pointers.py
===================================================================
RCS file: /cvsroot/pygccxml/source/pyplusplus/code_creators/smart_pointers.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** smart_pointers.py 28 Feb 2006 07:31:32 -0000 1.5
--- smart_pointers.py 6 Apr 2006 06:15:58 -0000 1.6
***************
*** 59,62 ****
--- 59,63 ----
if self.class_creator \
and self.class_creator.held_type \
+ and isinstance( self.class_creator.held_type, held_type_t ) \
and self.class_creator.held_type.smart_ptr == self.smart_ptr \
and self.target_configuration.boost_python_has_wrapper_held_type:
|