pygccxml-commit Mailing List for C++ Python language bindings (Page 79)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(190) |
Apr
(166) |
May
(170) |
Jun
(75) |
Jul
(105) |
Aug
(131) |
Sep
(99) |
Oct
(84) |
Nov
(67) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(66) |
Feb
(49) |
Mar
(25) |
Apr
(62) |
May
(21) |
Jun
(34) |
Jul
(9) |
Aug
(21) |
Sep
(5) |
Oct
|
Nov
(63) |
Dec
(34) |
2008 |
Jan
(10) |
Feb
(42) |
Mar
(26) |
Apr
(25) |
May
(6) |
Jun
(40) |
Jul
(18) |
Aug
(29) |
Sep
(6) |
Oct
(32) |
Nov
(14) |
Dec
(56) |
2009 |
Jan
(127) |
Feb
(52) |
Mar
(2) |
Apr
(10) |
May
(29) |
Jun
(3) |
Jul
|
Aug
(16) |
Sep
(4) |
Oct
(11) |
Nov
(8) |
Dec
(14) |
2010 |
Jan
(31) |
Feb
(1) |
Mar
(7) |
Apr
(9) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(8) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/pygccxml/source/pygccxml/declarations In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pygccxml/declarations Modified Files: call_invocation.py declaration.py filtering.py filters.py pattern_parser.py templates.py type_traits.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: call_invocation.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/call_invocation.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** call_invocation.py 21 Dec 2005 07:29:23 -0000 1.4 --- call_invocation.py 6 Apr 2006 06:15:56 -0000 1.5 *************** *** 16,20 **** """ - import types import pattern_parser --- 16,19 ---- Index: filters.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/filters.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filters.py 30 Mar 2006 05:56:16 -0000 1.7 --- filters.py 6 Apr 2006 06:15:56 -0000 1.8 *************** *** 42,46 **** class and_matcher_t(matcher_base_t): ! """Combine several other matchers with "&".""" def __init__(self, matchers): matcher_base_t.__init__(self) --- 42,51 ---- class and_matcher_t(matcher_base_t): ! """Combine several other matchers with "&". ! ! For example: find all private functions with name XXX ! ! C{ matcher = access_type_matcher_t( 'private' ) & calldef_matcher_t( name='XXX' ) } ! """ def __init__(self, matchers): matcher_base_t.__init__(self) *************** *** 58,62 **** class or_matcher_t(matcher_base_t): ! """Combine several other matchers with "|".""" def __init__(self, matchers): matcher_base_t.__init__(self) --- 63,73 ---- class or_matcher_t(matcher_base_t): ! """Combine several other matchers with "|". ! ! For example: find all functions and variables with name 'XXX' ! ! C{ matcher = variable_matcher_t( name='XXX' ) | calldef_matcher_t( name='XXX' ) } ! ! """ def __init__(self, matchers): matcher_base_t.__init__(self) *************** *** 74,78 **** class not_matcher_t(matcher_base_t): ! """Return the inverse result of matcher""" def __init__(self, matcher): matcher_base_t.__init__(self) --- 85,95 ---- class not_matcher_t(matcher_base_t): ! """Return the inverse result of matcher, using "~" ! ! For example: find all private and protected declarations ! ! C{ matcher = ~access_type_matcher_t( 'private' ) } ! ! """ def __init__(self, matcher): matcher_base_t.__init__(self) *************** *** 86,111 **** class declaration_matcher_t( matcher_base_t ): def __init__( self, name=None, decl_type=None, header_dir=None, header_file=None ): ! """ Instance of this class will match declarations by next criteria: ! declaration type - any class that derives from L{pygccxml.declarations.declaration_t} class ! header - file in which declaration has been declarated. ! Header path should be absolute! - header directory - directory to which belongs file, in which - declaration has been declarated. - Header directory path should be absolute! - - declaration name - name of declaration, could be full name or - declaration name only. - - @param decl_type: reference to one of the classes that derives from L{declarations.declaration_t} class. - @param name: declaration name, could be full name. - @param header_dir: absolute directory path - @param header_file: absolute file path """ ! #An other option is that ! #pygccxml will create absolute path using os.path.abspath function. ! #But I think this is just wrong, because abspath wbuilds path using ! #cwd and this behaviour is fragile and not so easy to find the bug. matcher_base_t.__init__( self ) self.decl_type = decl_type --- 103,133 ---- class declaration_matcher_t( matcher_base_t ): + """ + Instance of this class will match declarations by next criteria: + - declaration name, also could be fully qualified name + Example: wstring or ::std::wstring + - declaration type + Example: L{class_t}, L{namespace_t}, L{enumeration_t} + - location within file system ( file or directory ) + """ def __init__( self, name=None, decl_type=None, header_dir=None, header_file=None ): ! """ ! @param decl_type: declaration type to match by. For example L{enumeration_t}. ! @type decl_type: any class that derives from L{declarations.declaration_t} class ! ! @param name: declaration name, could be full name. ! @type name: str ! ! @param header_dir: absolute directory path ! @type header_dir: str ! ! @param header_file: absolute file path ! @type header_file: str """ ! #An other option is that pygccxml will create absolute path using ! #os.path.abspath function. But I think this is just wrong, because abspath ! #builds path using current working directory. This behaviour is fragile ! #and very difficult to find a bug. matcher_base_t.__init__( self ) self.decl_type = decl_type *************** *** 222,228 **** class variable_matcher_t( declaration_matcher_t ): ! def __init__( self, name=None, type=None, decl_type=None, header_dir=None, header_file=None ): """ ! type could be string or instance of class derived from cpptypes.type_t """ declaration_matcher_t.__init__( self --- 244,256 ---- class variable_matcher_t( declaration_matcher_t ): ! """ ! Instance of this class will match variables by next criteria: ! - L{declaration_matcher_t} criteria ! - variable type. Example: L{int_t} or 'int' ! """ ! def __init__( self, name=None, type=None, header_dir=None, header_file=None ): """ ! @param type: variable type ! @type type: string or instance of L{type_t} derived class """ declaration_matcher_t.__init__( self *************** *** 257,260 **** --- 285,290 ---- class namespace_matcher_t( declaration_matcher_t ): + """Instance of this class will match namespaces by name.""" + def __init__( self, name=None ): declaration_matcher_t.__init__( self, name=name, decl_type=namespace.namespace_t) *************** *** 265,279 **** class calldef_matcher_t( declaration_matcher_t ): def __init__( self, name=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None): ! """Constructor. ! ! return_value_type could be string or instance of class derived from ! cpptypes.type_t ! arg_types could be a list of strings or cpptypes.type_t. ! It could be a mix. In this case you should specify all arguments. ! If you don't want to match some argument you can insert None ! instead. ! In future it should be possible to select function by it's ! default argument value and/or exception .... """ if None is decl_type: --- 295,320 ---- class calldef_matcher_t( declaration_matcher_t ): + """ + Instance of this class will match callables by next criteria: + - L{declaration_matcher_t} criteria + - return type. Example: L{int_t} or 'int' + - argument types + """ + def __init__( self, name=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None): ! """ ! @param return_type: callable return type ! @type return_type: string or instance of L{type_t} derived class ! ! @param arg_types: list of function argument types. arg_types can contain. ! Any item within the list could be string or instance of L{type_t} derived ! class. If you don't want some argument to participate in match you can ! put None. For example: ! ! C{ calldef_matcher_t( arg_types=[ 'int &', None ] ) } ! ! will match all functions that takes 2 arguments, where the first one is ! reference to integer and second any ! @type arg_types: list """ if None is decl_type: *************** *** 334,338 **** --- 375,388 ---- class operator_matcher_t( calldef_matcher_t ): + """ + Instance of this class will match operators by next criteria: + - L{calldef_matcher_t} criteria + - operator symbol: =, !=, (), [] and etc + """ def __init__( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None): + """ + @param symbol: operator symbol + @type symbol: str + """ if None is decl_type: decl_type = calldef.operator_t *************** *** 365,369 **** --- 415,435 ---- class regex_matcher_t( matcher_base_t ): + """ + Instance of this class will match declaration using regular expression. + User should supply a function that will extract from declaration desired + information as string. Later, this matcher will match that string using + user regular expression. + """ def __init__( self, regex, function=None ): + """ + @param regex: regular expression + @type regex: string, an instance of this class will compile it for you + + @param function: function that will be called to get an information from + declaration as string. As input this function takes 1 argument: reference + to declaration. Return value should be string. If function is None, then + the matcher will use declaration name. + + """ matcher_base_t.__init__(self) self.regex = re.compile( regex ) *************** *** 380,384 **** --- 446,461 ---- class access_type_matcher_t( matcher_base_t ): + """ + Instance of this class will match declaration by its access type: public, + private or protected. If declarations does not have access type, for example + free function, then False will be returned. + """ + def __init__( self, access_type ): + """ + @param access_type: declaration access type + @type access_type: L{ACCESS_TYPES} defines few consts for your convinience. + Any way you can pass public, private or protected as argument to this function + """ matcher_base_t.__init__( self ) self.access_type = access_type Index: declaration.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/declaration.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** declaration.py 22 Mar 2006 10:37:47 -0000 1.20 --- declaration.py 6 Apr 2006 06:15:56 -0000 1.21 *************** *** 12,16 **** import algorithm - import pygccxml.utils import templates --- 12,15 ---- Index: type_traits.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/type_traits.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** type_traits.py 5 Mar 2006 05:41:11 -0000 1.23 --- type_traits.py 6 Apr 2006 06:15:56 -0000 1.24 *************** *** 395,407 **** return found ! def __normalize( self, type ): ! type = remove_alias( type ) ! bt_of_type = base_type( type ) if isinstance( bt_of_type, cpptypes.declarated_t ) \ and isinstance( bt_of_type.declaration, class_declaration.class_declaration_t ): ! type = type.clone() ! bt_of_type = base_type( type ) bt_of_type.declaration = self.__find_class_by_class_declaration( bt_of_type.declaration ) ! return type def __test_trivial( self, source, target ): --- 395,407 ---- return found ! def __normalize( self, type_ ): ! type_ = remove_alias( type_ ) ! bt_of_type = base_type( type_ ) if isinstance( bt_of_type, cpptypes.declarated_t ) \ and isinstance( bt_of_type.declaration, class_declaration.class_declaration_t ): ! type_ = type_.clone() ! bt_of_type = base_type( type_ ) bt_of_type.declaration = self.__find_class_by_class_declaration( bt_of_type.declaration ) ! return type_ def __test_trivial( self, source, target ): *************** *** 594,598 **** and is_both_declarated( base.base.base, derived.base ): return True ! def is_convertible( self ): source = self.__source --- 594,599 ---- and is_both_declarated( base.base.base, derived.base ): return True ! return False ! def is_convertible( self ): source = self.__source *************** *** 639,643 **** if isinstance( target, cpptypes.declarated_t ): assert isinstance( target.declaration, class_declaration.class_t ) - target_inst = target.declaration constructors = algorithm.find_all_declarations( target.declaration.declarations , type=calldef.constructor_t --- 640,643 ---- Index: filtering.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/filtering.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filtering.py 22 Jan 2006 13:09:18 -0000 1.7 --- filtering.py 6 Apr 2006 06:15:56 -0000 1.8 *************** *** 21,28 **** normalize_path = staticmethod( normalize_path ) ! def __contains_parent_dir( fpath, dirs ): #precondition: dirs and fpath should be normalize_path'ed before calling this function return bool( filter( lambda dir: fpath.startswith( dir ), dirs ) ) ! __contains_parent_dir = staticmethod( __contains_parent_dir ) def by_location( decls, locations ): --- 21,28 ---- normalize_path = staticmethod( normalize_path ) ! def contains_parent_dir( fpath, dirs ): #precondition: dirs and fpath should be normalize_path'ed before calling this function return bool( filter( lambda dir: fpath.startswith( dir ), dirs ) ) ! contains_parent_dir = staticmethod( contains_parent_dir ) def by_location( decls, locations ): *************** *** 53,57 **** continue fpath = filtering.normalize_path( decl.location.file_name ) ! if filtering.__contains_parent_dir( fpath, dirs ) or fpath in files: result.append( decl ) return result --- 53,57 ---- continue fpath = filtering.normalize_path( decl.location.file_name ) ! if filtering.contains_parent_dir( fpath, dirs ) or fpath in files: result.append( decl ) return result Index: pattern_parser.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/pattern_parser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pattern_parser.py 30 Mar 2006 08:09:41 -0000 1.4 --- pattern_parser.py 6 Apr 2006 06:15:56 -0000 1.5 *************** *** 88,91 **** --- 88,92 ---- pass previous_found = found + 1 #skip found sep + #TODO: find out what is args and correct the code return [ arg.strip() for arg in args ] Index: templates.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/templates.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** templates.py 21 Dec 2005 07:29:23 -0000 1.7 --- templates.py 6 Apr 2006 06:15:56 -0000 1.8 *************** *** 16,20 **** """ - import types import pattern_parser --- 16,19 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:56
|
Update of /cvsroot/pygccxml/source/pyplusplus/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/utils Modified Files: __init__.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: __init__.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/utils/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 29 Mar 2006 04:26:59 -0000 1.2 --- __init__.py 6 Apr 2006 06:16:09 -0000 1.3 *************** *** 9,14 **** """ - import re - import types from pygccxml import declarations from pyplusplus import code_creators --- 9,12 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:56
|
Update of /cvsroot/pygccxml/source/pyplusplus/module_creator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/module_creator Modified Files: call_policies_resolver.py class_organizer.py creator.py types_database.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: types_database.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_creator/types_database.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** types_database.py 28 Feb 2006 07:31:33 -0000 1.10 --- types_database.py 6 Apr 2006 06:16:09 -0000 1.11 *************** *** 123,127 **** converter = spconverter_t( smart_ptr=registrator.smart_ptr , source=hierarchy_info.related_class ! , target=class_decl ) answer.append( converter ) return answer --- 123,127 ---- converter = spconverter_t( smart_ptr=registrator.smart_ptr , source=hierarchy_info.related_class ! , target=class_creator.declaration ) answer.append( converter ) return answer Index: call_policies_resolver.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_creator/call_policies_resolver.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** call_policies_resolver.py 30 Mar 2006 08:09:42 -0000 1.14 --- call_policies_resolver.py 6 Apr 2006 06:16:09 -0000 1.15 *************** *** 4,8 **** # http://www.boost.org/LICENSE_1_0.txt) - import os from pygccxml import declarations from pyplusplus import decl_wrappers --- 4,7 ---- *************** *** 89,93 **** if calldef.symbol != '[]': return None ! return_type = declarations.remove_cv( calldef.return_type ) if declarations.is_reference( return_type ): --- 88,92 ---- if calldef.symbol != '[]': return None ! return_type = declarations.remove_cv( calldef.return_type ) if declarations.is_reference( return_type ): *************** *** 98,107 **** else: return decl_wrappers.return_value_policy( decl_wrappers.copy_non_const_reference ) - elif declarations.is_reference( return_type ): - #reference, but not funcdamental type - #In future may be I should check whether class is copyable or not - return decl_wrappers.return_internal_reference() else: ! return None class built_in_resolver_t(resolver_t): --- 97,102 ---- else: return decl_wrappers.return_value_policy( decl_wrappers.copy_non_const_reference ) else: ! return decl_wrappers.return_internal_reference() class built_in_resolver_t(resolver_t): Index: creator.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_creator/creator.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** creator.py 19 Mar 2006 13:35:39 -0000 1.63 --- creator.py 6 Apr 2006 06:16:09 -0000 1.64 *************** *** 4,12 **** # http://www.boost.org/LICENSE_1_0.txt) - import types from pygccxml import declarations from pyplusplus import code_creators import class_organizer - from sets import Set as set import call_policies_resolver import types_database --- 4,10 ---- Index: class_organizer.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/module_creator/class_organizer.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** class_organizer.py 14 Feb 2006 13:57:46 -0000 1.6 --- class_organizer.py 6 Apr 2006 06:16:09 -0000 1.7 *************** *** 4,8 **** # http://www.boost.org/LICENSE_1_0.txt) - import os from pygccxml import declarations from sets import Set as set --- 4,7 ---- *************** *** 61,65 **** return i_depend_on_them ! def __get_top_class_inst( seld, decl ): curr = decl while isinstance( curr.parent, declarations.class_t ): --- 60,64 ---- return i_depend_on_them ! def __get_top_class_inst( self, decl ): curr = decl while isinstance( curr.parent, declarations.class_t ): |
From: Roman <rom...@us...> - 2006-04-06 06:16:56
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/py_date_time In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/examples/py_date_time Modified Files: _date_time_.suo environment.py Removed Files: create_date_time.py create_package.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: environment.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/py_date_time/environment.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** environment.py 21 Mar 2006 08:07:25 -0000 1.8 --- environment.py 6 Apr 2006 06:16:06 -0000 1.9 *************** *** 22,27 **** date_time_pypp_include = '' ! defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT']#[ 'BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS' ! # , 'DATE_TIME_INLINE' ] if sys.platform == 'win32': defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] ) --- 22,27 ---- date_time_pypp_include = '' ! defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT'] ! if sys.platform == 'win32': defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] ) --- create_package.py DELETED --- --- create_date_time.py DELETED --- Index: _date_time_.suo =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/py_date_time/_date_time_.suo,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvsm4pQ97 and /tmp/cvsxdIFKy differ |
From: Roman <rom...@us...> - 2006-04-06 06:16:47
|
Update of /cvsroot/pygccxml/source/pyplusplus/file_writers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/file_writers Modified Files: multiple_files.py writer.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: writer.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/file_writers/writer.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** writer.py 9 Mar 2006 10:58:23 -0000 1.13 --- writer.py 6 Apr 2006 06:16:08 -0000 1.14 *************** *** 5,12 **** import os ! import shutil from pyplusplus import code_repository - class writer_t(object): """Base class for all module/code writers. --- 5,12 ---- import os ! import time ! from pyplusplus import _logging_ from pyplusplus import code_repository class writer_t(object): """Base class for all module/code writers. *************** *** 43,46 **** --- 43,48 ---- def write_file( fpath, content ): + _logging_.logger.debug( 'write code to file "%s" - started' % fpath ) + start_time = time.clock() fcontent_new = [] fcontent_new.append( '// This file has been generated by pyplusplus.' ) *************** *** 56,63 **** --- 58,72 ---- f.close() if fcontent == fcontent_new: + _logging_.logger.debug( 'file was not changed - done( %f seconds )' + % ( time.clock() - start_time ) ) return + else: + _logging_.logger.debug( 'file does not exist' ) + writer_t.create_backup( fpath ) f = file( fpath, 'w+b' ) f.write( fcontent_new ) f.close() + _logging_.logger.debug( 'write code - done( %f seconds )' % ( time.clock() - start_time ) ) + write_file = staticmethod( write_file ) Index: multiple_files.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/file_writers/multiple_files.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** multiple_files.py 28 Feb 2006 07:31:33 -0000 1.15 --- multiple_files.py 6 Apr 2006 06:16:08 -0000 1.16 *************** *** 152,155 **** --- 152,156 ---- self.split_creators( creators, '_free_functions', 'register_free_functions', -1 ) + #TODO: move write_main to __init__ def write(self, write_main=True): """ Write out the module. |
From: Roman <rom...@us...> - 2006-04-06 06:16:47
|
Update of /cvsroot/pygccxml/source/pyplusplus/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/unittests Modified Files: autoconfig.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: autoconfig.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/unittests/autoconfig.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** autoconfig.py 14 Dec 2005 09:09:53 -0000 1.21 --- autoconfig.py 6 Apr 2006 06:16:09 -0000 1.22 *************** *** 10,13 **** --- 10,17 ---- from sets import Set as set + #__pychecker__ = 'limit=1000' + #import pychecker.checker + + boost_path = '' gccxml_path = '' |
From: Roman <rom...@us...> - 2006-04-06 06:16:47
|
Update of /cvsroot/pygccxml/source/pyplusplus/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/gui Modified Files: ui.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: ui.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/gui/ui.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ui.py 29 Mar 2006 06:05:19 -0000 1.22 --- ui.py 6 Apr 2006 06:16:08 -0000 1.23 *************** *** 10,23 **** import Tkinter import tkFileDialog - import tkMessageBox import tkSimpleDialog - if sys.platform == 'win32': - sys.path.append( r'D:\pygccxml_sources\source' ) - gccxml = 'c:/tools/gccxml/bin/gccxml.exe' - else: - sys.path.append( '/home/roman/pygccxml_sources/source' ) - gccxml = '/home/roman/gccxml/bin/gccxml' - from pygccxml import parser from pyplusplus import module_builder --- 10,15 ---- |
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: |
From: Roman <rom...@us...> - 2006-04-06 06:16:46
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/tutorials In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/examples/tutorials Modified Files: hello_world.hpp Removed Files: advanced.py simple.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: hello_world.hpp =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/tutorials/hello_world.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hello_world.hpp 24 Jan 2006 05:46:29 -0000 1.1 --- hello_world.hpp 6 Apr 2006 06:16:08 -0000 1.2 *************** *** 9,21 **** #include <string> ! namespace pypp{ ! inline std::string ! identity( const std::string& msg ){ ! return msg; ! } ! } #endif//__hello_world_hpp__ --- 9,41 ---- #include <string> ! //I want to rename color to Color ! enum color{ red, green, blue }; ! struct animal{ ! ! animal( const std::string& name="" ) ! : m_name( name ) ! {} ! ! //I need to set call policies to the function ! const std::string* get_name_ptr() const ! { return &m_name; } ! const std::string& name() const ! { return m_name; } ! ! private: ! std::string m_name; ! ! }; + //I want to exclude next declarations: + struct impl1{}; + struct impl2{}; + + inline int* get_int_ptr(){ return 0;} + inline int* get_int_ptr(int){ return 0;} + inline int* get_int_ptr(double){ return 0;} + #endif//__hello_world_hpp__ --- simple.py DELETED --- --- advanced.py DELETED --- |
From: Roman <rom...@us...> - 2006-04-06 06:16:46
|
Update of /cvsroot/pygccxml/source/pygccxml/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pygccxml/parser Modified Files: declarations_cache.py directory_cache.py patcher.py project_reader.py scanner.py source_reader.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: scanner.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/parser/scanner.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** scanner.py 9 Mar 2006 01:46:15 -0000 1.22 --- scanner.py 6 Apr 2006 06:15:58 -0000 1.23 *************** *** 252,256 **** def __read_array_type( self, attrs ): ! type = attrs[ XML_AN_TYPE ] size = array_t.SIZE_UNKNOWN if attrs.has_key(XML_AN_MAX): --- 252,256 ---- def __read_array_type( self, attrs ): ! type_ = attrs[ XML_AN_TYPE ] size = array_t.SIZE_UNKNOWN if attrs.has_key(XML_AN_MAX): *************** *** 263,267 **** except ValueError: warnings.warn( 'unable to find out array size from expression "%s"' % attrs[ XML_AN_MAX ] ) ! return array_t( type, size + 1 ) def __read_cv_qualified_type( self, attrs ): --- 263,267 ---- except ValueError: warnings.warn( 'unable to find out array size from expression "%s"' % attrs[ XML_AN_MAX ] ) ! return array_t( type_, size + 1 ) def __read_cv_qualified_type( self, attrs ): *************** *** 286,290 **** try: return FUNDAMENTAL_TYPES[ attrs[XML_AN_NAME] ] ! except KeyError, error: raise RuntimeError( "pygccxml error: unable to find fundamental type with name '%s'." % attrs[XML_AN_NAME] ) --- 286,290 ---- try: return FUNDAMENTAL_TYPES[ attrs[XML_AN_NAME] ] ! except KeyError: raise RuntimeError( "pygccxml error: unable to find fundamental type with name '%s'." % attrs[XML_AN_NAME] ) *************** *** 292,297 **** def __read_offset_type( self,attrs ): base = attrs[ XML_AN_BASE_TYPE ] ! type = attrs[ XML_AN_TYPE ] ! return member_variable_type_t( class_inst=base, variable_type=type ) def __read_argument( self, attrs ): --- 292,297 ---- def __read_offset_type( self,attrs ): base = attrs[ XML_AN_BASE_TYPE ] ! type_ = attrs[ XML_AN_TYPE ] ! return member_variable_type_t( class_inst=base, variable_type=type_ ) def __read_argument( self, attrs ): Index: declarations_cache.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/parser/declarations_cache.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** declarations_cache.py 9 Mar 2006 01:46:15 -0000 1.12 --- declarations_cache.py 6 Apr 2006 06:15:58 -0000 1.13 *************** *** 6,10 **** import os - import sys import md5 import time --- 6,9 ---- *************** *** 158,162 **** logger.info( "Found cache in file: [%s] entries: %s" % ( file_name, len( cache.keys() ) ) ) ! except Exception, error: cache_file_obj.close() logger.info( "Invalid cache file: [%s] Regenerating." % file_name ) --- 157,161 ---- logger.info( "Found cache in file: [%s] entries: %s" % ( file_name, len( cache.keys() ) ) ) ! except Exception: cache_file_obj.close() logger.info( "Invalid cache file: [%s] Regenerating." % file_name ) Index: directory_cache.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/parser/directory_cache.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** directory_cache.py 8 Mar 2006 08:37:20 -0000 1.2 --- directory_cache.py 6 Apr 2006 06:15:58 -0000 1.3 *************** *** 141,146 **** filesigs = [] for filename in dependent_files: ! id,sig = self.__filename_rep.acquire_filename(filename) ! filesigs.append((id,sig)) configsig = self._create_config_signature(configuration) --- 141,146 ---- filesigs = [] for filename in dependent_files: ! id_,sig = self.__filename_rep.acquire_filename(filename) ! filesigs.append((id_,sig)) configsig = self._create_config_signature(configuration) *************** *** 188,193 **** # Check if any of the dependent files has been modified... ! for id, sig in entry.filesigs: ! if self.__filename_rep.is_file_modified(id, sig): # print "CACHE: %s: Entry not up to date"%source_file return None --- 188,193 ---- # Check if any of the dependent files has been modified... ! for id_, sig in entry.filesigs: ! if self.__filename_rep.is_file_modified(id_, sig): # print "CACHE: %s: Entry not up to date"%source_file return None *************** *** 292,297 **** # Release the referenced files... ! for id, sig in entry.filesigs: ! self.__filename_rep.release_filename(id) # Remove the cache entry... --- 292,297 ---- # Release the referenced files... ! for id_, sig in entry.filesigs: ! self.__filename_rep.release_filename(id_) # Remove the cache entry... *************** *** 416,423 **** self._md5_sigs = md5_sigs ! # ID lookup table (key: filename / value: id) self.__id_lut = {} ! # Entry dictionary (key: id / value: filename_entry_t) # This dictionary contains the actual data. # It must always hold that each entry in __entries has a corresponding --- 416,423 ---- self._md5_sigs = md5_sigs ! # ID lookup table (key: filename / value: id_) self.__id_lut = {} ! # Entry dictionary (key: id_ / value: filename_entry_t) # This dictionary contains the actual data. # It must always hold that each entry in __entries has a corresponding *************** *** 432,469 **** """Acquire a file name and return its id and its signature. """ ! id = self.__id_lut.get(name) # Is this a new entry? ! if id==None: # then create one... ! id = self.__next_id self.__next_id += 1 ! self.__id_lut[name] = id entry = filename_entry_t(name) ! self.__entries[id] = entry else: # otherwise obtain the entry... ! entry = self.__entries[id] entry.inc_ref_count() ! return id, self._get_signature(entry) ! def release_filename(self, id): """Release a file name. """ ! entry = self.__entries.get(id) if entry==None: ! raise ValueError, "Invalid filename id (%d)"%id # Decrease reference count and check if the entry has to be removed... if entry.dec_ref_count()==0: ! del self.__entries[id] del self.__id_lut[entry.filename] ! def is_file_modified(self, id, signature): ! """Check if the file referred to by id has been modified. """ ! entry = self.__entries.get(id) if entry==None: ! raise ValueError, "Invalid filename id (%d)"%id # Is the signature already known? --- 432,469 ---- """Acquire a file name and return its id and its signature. """ ! id_ = self.__id_lut.get(name) # Is this a new entry? ! if id_==None: # then create one... ! id_ = self.__next_id self.__next_id += 1 ! self.__id_lut[name] = id_ entry = filename_entry_t(name) ! self.__entries[id_] = entry else: # otherwise obtain the entry... ! entry = self.__entries[id_] entry.inc_ref_count() ! return id_, self._get_signature(entry) ! def release_filename(self, id_): """Release a file name. """ ! entry = self.__entries.get(id_) if entry==None: ! raise ValueError, "Invalid filename id (%d)"%id_ # Decrease reference count and check if the entry has to be removed... if entry.dec_ref_count()==0: ! del self.__entries[id_] del self.__id_lut[entry.filename] ! def is_file_modified(self, id_, signature): ! """Check if the file referred to by id_ has been modified. """ ! entry = self.__entries.get(id_) if entry==None: ! raise ValueError, "Invalid filename id_ (%d)"%id_ # Is the signature already known? *************** *** 480,484 **** def update_id_counter(self): ! """Update the id counter so that it doesn't grow forever. """ if len(self.__entries)==0: --- 480,484 ---- def update_id_counter(self): ! """Update the id_ counter so that it doesn't grow forever. """ if len(self.__entries)==0: *************** *** 516,528 **** print "ID lookup table:" for name in self.__id_lut: ! id = self.__id_lut[name] ! print " %s -> %d"%(name, id) print 70*"-" print "%-4s %-60s %s"%("ID", "Filename", "Refcount") print 70*"-" ! for id in self.__entries: ! entry = self.__entries[id] ! print "%04d %-60s %d"%(id, entry.filename, entry.refcount) --- 516,528 ---- print "ID lookup table:" for name in self.__id_lut: ! id_ = self.__id_lut[name] ! print " %s -> %d"%(name, id_) print 70*"-" print "%-4s %-60s %s"%("ID", "Filename", "Refcount") print 70*"-" ! for id_ in self.__entries: ! entry = self.__entries[id_] ! print "%04d %-60s %d"%(id_, entry.filename, entry.refcount) Index: patcher.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/parser/patcher.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** patcher.py 9 Feb 2006 11:33:55 -0000 1.10 --- patcher.py 6 Apr 2006 06:15:58 -0000 1.11 *************** *** 4,8 **** # http://www.boost.org/LICENSE_1_0.txt) - import re from pygccxml import declarations --- 4,7 ---- *************** *** 133,137 **** found1 = call_invocation.find_args( dv ) found2 = call_invocation.find_args( dv, found1[1] + 1 ) ! args1 = call_invocation.args( dv[ found1[0] : found1[1] + 1 ] ) args2 = call_invocation.args( dv[ found2[0] : found2[1] + 1 ] ) return call_invocation.join( dv[:found1[0]], args2 ) --- 132,136 ---- found1 = call_invocation.find_args( dv ) found2 = call_invocation.find_args( dv, found1[1] + 1 ) ! #args1 = call_invocation.args( dv[ found1[0] : found1[1] + 1 ] ) args2 = call_invocation.args( dv[ found2[0] : found2[1] + 1 ] ) return call_invocation.join( dv[:found1[0]], args2 ) Index: source_reader.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/parser/source_reader.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** source_reader.py 9 Mar 2006 01:46:15 -0000 1.27 --- source_reader.py 6 Apr 2006 06:15:58 -0000 1.28 *************** *** 108,113 **** if self.__config.verbose: logger.info( " Command line for GCC-XML: %s" % command_line ) ! input, output = os.popen4( command_line ) ! input.close() #output = os.popen(command_line) gccxml_reports = [] --- 108,113 ---- if self.__config.verbose: logger.info( " Command line for GCC-XML: %s" % command_line ) ! input_, output = os.popen4( command_line ) ! input_.close() #output = os.popen(command_line) gccxml_reports = [] *************** *** 205,209 **** return os.path.normpath( abs_file_path ) return file_path ! except Exception, error: return file_path --- 205,209 ---- return os.path.normpath( abs_file_path ) return file_path ! except Exception: return file_path *************** *** 221,228 **** , membership=scanner_.members() , files=files ) ! for type in list( types.itervalues() ): #I need this copy because internaly linker change types collection ! linker_.instance = type ! apply_visitor( linker_, type ) for decl in decls.itervalues(): linker_.instance = decl --- 221,228 ---- , membership=scanner_.members() , files=files ) ! for type_ in list( types.itervalues() ): #I need this copy because internaly linker change types collection ! linker_.instance = type_ ! apply_visitor( linker_, type_ ) for decl in decls.itervalues(): linker_.instance = decl Index: project_reader.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/parser/project_reader.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** project_reader.py 21 Mar 2006 08:07:25 -0000 1.28 --- project_reader.py 6 Apr 2006 06:15:58 -0000 1.29 *************** *** 5,9 **** import os - import sys import time import types --- 5,8 ---- *************** *** 108,112 **** self.__decl_factory = pygccxml.declarations.decl_factory_t() ! def get_os_file_names( self, files ): """Returns a list of OS file names --- 107,111 ---- self.__decl_factory = pygccxml.declarations.decl_factory_t() ! def get_os_file_names( files ): """Returns a list of OS file names *************** *** 126,129 **** --- 125,129 ---- pass return fnames + get_os_file_names = staticmethod( get_os_file_names ) def read_files( self, files, compilation_mode=COMPILATION_MODE.FILE_BY_FILE): |
From: Roman <rom...@us...> - 2006-04-06 06:16:45
|
Update of /cvsroot/pygccxml/source/pyplusplus/decl_wrappers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/decl_wrappers Modified Files: algorithm.py call_policies.py calldef_wrapper.py decl_wrapper.py decl_wrapper_printer.py mdecl_wrapper.py namespace_wrapper.py scopedef_wrapper.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: mdecl_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/mdecl_wrapper.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mdecl_wrapper.py 6 Mar 2006 05:02:41 -0000 1.1 --- mdecl_wrapper.py 6 Apr 2006 06:15:59 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- class call_redirector_t( object ): + """Internal class used to call some function of objects""" def __init__( self, name, decls ): object.__init__( self ) *************** *** 12,27 **** def __call__( self, *arguments, **keywords ): for d in self.decls: ! callable = getattr(d, self.name) ! callable( *arguments, **keywords ) class mdecl_wrapper_t( object ): def __init__( self, decls ): object.__init__( self ) self.__dict__['_decls'] = decls def __len__( self ): return len( self._decls ) def __getitem__( self, index ): return self._decls[index] --- 13,46 ---- def __call__( self, *arguments, **keywords ): for d in self.decls: ! callable_ = getattr(d, self.name) ! callable_( *arguments, **keywords ) class mdecl_wrapper_t( object ): + """Multiple declarations wrapper. + + The main purpose of this class is to allow an user to work on many + declarations, as they were only one single declaration. + + Example: + mb = module_builder_t( ... ) + #lets say we want to exclude all member functions, that returns reference to int: + mb.member_functions( return_type='int &' ).exclude() + + "exclude" function will be called on every function that match the criteria. + """ + def __init__( self, decls ): + """@param decls: list of declarations to operate on. + @type decls: list of L{declaration wrappers<decl_wrapper_t>} + """ object.__init__( self ) self.__dict__['_decls'] = decls def __len__( self ): + """returns the number of declarations""" return len( self._decls ) def __getitem__( self, index ): + """provides access to declaration""" return self._decls[index] *************** *** 32,35 **** --- 51,58 ---- def __setattr__( self, name, value ): + """Updates the value of attribute on all declarations. + @param name: name of attribute + @param value: new value of attribute + """ self.__ensure_attribute( name ) for d in self._decls: *************** *** 37,39 **** --- 60,64 ---- def __getattr__( self, name ): + """@param name: name of method + """ return call_redirector_t( name, self._decls ) \ No newline at end of file Index: call_policies.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/call_policies.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** call_policies.py 22 Mar 2006 08:05:35 -0000 1.2 --- call_policies.py 6 Apr 2006 06:15:59 -0000 1.3 *************** *** 8,19 **** --- 8,29 ---- class CREATION_POLICY: + """Implementation details""" AS_INSTANCE = 'as instance' AS_TEMPLATE_ARGUMENT = 'as template argument' class call_policy_t(object): + """Base class for all call polices classes""" def __init__(self): object.__init__(self) def create(self, function_creator, creation_policy=CREATION_POLICY.AS_INSTANCE): + """Creates code from the call policies class instance. + @param function_creator: parent code creator + @type function_creator: L{code_creators.function_t} or L{code_creators.constructor_t} + + @param creation_policy: indicates whether we this call policy used as template + argument or as an instance + @type creation_policy: L{CREATION_POLICY} + """ code = self._create_impl( function_creator ) if creation_policy == CREATION_POLICY.AS_INSTANCE: *************** *** 25,28 **** --- 35,39 ---- class default_t(call_policy_t): + """implementation for ::boost::python::default_call_policies""" def __init__( self ): call_policy_t.__init__( self ) *************** *** 35,38 **** --- 46,50 ---- def default_call_policies(): + """create ::boost::python::default_call_policies""" return default_t() Index: scopedef_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/scopedef_wrapper.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** scopedef_wrapper.py 30 Mar 2006 05:56:17 -0000 1.7 --- scopedef_wrapper.py 6 Apr 2006 06:15:59 -0000 1.8 *************** *** 9,14 **** from sets import Set as set import time ! class scopedef_t(decl_wrapper.decl_wrapper_t): RECURSIVE_DEFAULT = True ALLOW_EMPTY_MDECL_WRAPPER = False --- 9,56 ---- from sets import Set as set import time + from pyplusplus import _logging_ ! class scopedef_t(decl_wrapper.decl_wrapper_t): ! """In C++ there are 2 declarations that can contain definition of other ! declarations: class and namespace. This class is used as abase class for both ! of them. ! ! Also this class provides "get/select/find" interface. Using this class you ! can get instance or instances of internal declaration(s). ! ! You can find declaration(s) using next criteria: ! 1. name - declaration name, could be full qualified name ! 2. header_dir - directory, to which belongs file, that the declaration was declarated in. ! header_dir should be absolute path. ! 3. header_file - file that the declaration was declarated in. ! 4. function - user ( your ) custom criteria. The interesting thing is that ! this function will be joined with other arguments ( criteria ). ! 5 recursive - the search declaration range, if True will be search in ! internal declarations too. ! ! Every "select" API you can invoke and pass as first argument at declaration ! name or function. This class will find out correctly what argument represents. ! ! Example: ! ns - referers to global namespace ! ns.member_function( "do_something ) - will return reference to member ! function named "do_something". If there is no such function exception ! will be raised. If there is more then one function exception will be ! raised too. ! ! Example 2: ! ns - referers to global namespace ! do_smths = ns.member_functions( "do_something ) - will return instance ! of L{mdecl_wrapper_t} object. This object allows you few things: ! ! 1. To iterate on selected declarations ! 2. To set some property to desired value using one line of code only: ! do_smths.call_policies = x ! 3. To call some function on every instance using one line of code: ! do_smths.exclude() ! ! Pay attention: you can not use "get" functions or properties. ! """ ! RECURSIVE_DEFAULT = True ALLOW_EMPTY_MDECL_WRAPPER = False *************** *** 41,44 **** --- 83,87 ---- def clear_optimizer(self): + """Cleans query optimizer state""" self.__optimized = False self.__type2decls = {} *************** *** 47,54 **** self.__type2name2decls_nr = {} self.__all_decls = None ! def init_optimizer(self): self.clear_optimizer() - #start_time = time.clock() decl_types = [ declarations.scopedef_t --- 90,114 ---- self.__type2name2decls_nr = {} self.__all_decls = None ! ! map( lambda decl: decl.clear_optimizer() ! , filter( lambda decl: isinstance( decl, declarations.scopedef_t ) ! , self.declarations ) ) ! def init_optimizer(self): + """Initializes query optimizer state. + There are 4 internals hash tables: + 1. from type to declarations + 2. from type to declarations for non-recursive queries + 3. from type to name to declarations + 4. from type to name to declarations for non-recursive queries + + Almost every query includes declaration type information. Also very + common query is to search some declaration(s) by name or full name. + Those hashtables allows to search declaration very quick. + """ + _logging_.logger.debug( "preparing data structures for query optimizer - started" ) + start_time = time.clock() + self.clear_optimizer() decl_types = [ declarations.scopedef_t *************** *** 92,105 **** name2decls_nr[ decl.name ].append( decl ) ! #decl_wrapper.logger.info( 'Time took to optimize data strucutres: ! #print 'time taken : ', time.clock() - start_time, ' seconds' ! self.__optimized = True def exclude( self ): self.ignore = True map( lambda decl: decl.exclude(), self.declarations ) def include( self ): self.ignore = False map( lambda decl: decl.include(), self.declarations ) --- 152,170 ---- name2decls_nr[ decl.name ].append( decl ) ! map( lambda decl: decl.init_optimizer() ! , filter( lambda decl: isinstance( decl, declarations.scopedef_t ) ! , self.declarations ) ) ! ! _logging_.logger.debug( "preparing data structures for query optimizer - done( %f seconds ). " ! % ( time.clock() - start_time ) ) self.__optimized = True def exclude( self ): + """Exclude "self" and child declarations from being exposed.""" self.ignore = True map( lambda decl: decl.exclude(), self.declarations ) def include( self ): + """Include "self" and child declarations to be exposed.""" self.ignore = False map( lambda decl: decl.include(), self.declarations ) *************** *** 137,149 **** matcher = match_class( **matcher_args ) if keywds['function']: ! decl_wrapper.logger.info( 'running query: %s and <user defined function>' % str( matcher ) ) return lambda decl: matcher( decl ) and keywds['function'](decl) else: ! decl_wrapper.logger.info( 'running query: %s' % str( matcher ) ) return matcher def __findout_range( self, name, decl_type, recursive ): if not self.__optimized: ! decl_wrapper.logger.info( 'running non optimized query - optimization has not been done' ) decls = self.declarations if recursive: --- 202,214 ---- matcher = match_class( **matcher_args ) if keywds['function']: ! _logging_.logger.info( 'running query: %s and <user defined function>' % str( matcher ) ) return lambda decl: matcher( decl ) and keywds['function'](decl) else: ! _logging_.logger.info( 'running query: %s' % str( matcher ) ) return matcher def __findout_range( self, name, decl_type, recursive ): if not self.__optimized: ! _logging_.logger.info( 'running non optimized query - optimization has not been done' ) decls = self.declarations if recursive: *************** *** 156,180 **** name = matcher.decl_name_only if recursive: ! decl_wrapper.logger.info( 'running type + name optimized query recursively' ) return self.__type2name2decls[decl_type][name] else: ! decl_wrapper.logger.info( 'running type + name optimized query non recursively' ) return self.__type2name2decls_nr[decl_type][name] elif decl_type: if recursive: ! decl_wrapper.logger.info( 'running type optimized query recursively' ) return self.__type2decls[ decl_type ] else: ! decl_wrapper.logger.info( 'running type optimized query non recursively' ) return self.__type2decls_nr[ decl_type ] else: - decl_wrapper.logger.info( 'running non optimized query - query is more complex then type + name' ) if recursive: return self.__all_decls else: return self.declarations def _find_single( self, match_class, **keywds ): ! decl_wrapper.logger.info( 'running query - started' ) start_time = time.clock() norm_keywds = self.__normalize_args( **keywds ) --- 221,246 ---- name = matcher.decl_name_only if recursive: ! _logging_.logger.info( 'query has been optimized on type and name' ) return self.__type2name2decls[decl_type][name] else: ! _logging_.logger.info( 'non recursive query has been optimized on type and name' ) return self.__type2name2decls_nr[decl_type][name] elif decl_type: if recursive: ! _logging_.logger.info( 'query has been optimized on type' ) return self.__type2decls[ decl_type ] else: ! _logging_.logger.info( 'non recursive query has been optimized on type' ) return self.__type2decls_nr[ decl_type ] else: if recursive: + _logging_.logger.info( 'query has not been optimized ( hint: query does not contain type and/or name )' ) return self.__all_decls else: + _logging_.logger.info( 'non recursive query has not been optimized ( hint: query does not contain type and/or name )' ) return self.declarations def _find_single( self, match_class, **keywds ): ! _logging_.logger.info( 'find single query execution - started' ) start_time = time.clock() norm_keywds = self.__normalize_args( **keywds ) *************** *** 184,192 **** decls = self.__findout_range( norm_keywds['name'], dtype, recursive_ ) found = declarations.matcher.get_single( matcher, decls, False ) ! decl_wrapper.logger.info( 'query execution took : %f seconds' % ( time.clock() - start_time ) ) ! decl_wrapper.logger.info( 'running query - done' ) return found def _find_multiple( self, match_class, **keywds ): start_time = time.clock() norm_keywds = self.__normalize_args( **keywds ) --- 250,259 ---- decls = self.__findout_range( norm_keywds['name'], dtype, recursive_ ) found = declarations.matcher.get_single( matcher, decls, False ) ! _logging_.logger.info( 'find single query execution - done( %f seconds )' ! % ( time.clock() - start_time ) ) return found def _find_multiple( self, match_class, **keywds ): + _logging_.logger.info( 'find all query execution - started' ) start_time = time.clock() norm_keywds = self.__normalize_args( **keywds ) *************** *** 197,208 **** found = declarations.matcher.find( matcher, decls, False ) mfound = mdecl_wrapper.mdecl_wrapper_t( found ) ! decl_wrapper.logger.info( 'There are %d declarations that match query' % len(mfound) ) if not mfound and not self.ALLOW_EMPTY_MDECL_WRAPPER: raise RuntimeError( "Multi declaration query returned 0 declarations." ) - - decl_wrapper.logger.info( 'query execution took : %f seconds' % ( time.clock() - start_time ) ) return mfound def decl( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): return self._find_single( declarations.declaration_matcher_t , name=name --- 264,276 ---- found = declarations.matcher.find( matcher, decls, False ) mfound = mdecl_wrapper.mdecl_wrapper_t( found ) ! _logging_.logger.info( '%d declaration(s) that match query' % len(mfound) ) ! _logging_.logger.info( 'find single query execution - done( %f seconds )' ! % ( time.clock() - start_time ) ) if not mfound and not self.ALLOW_EMPTY_MDECL_WRAPPER: raise RuntimeError( "Multi declaration query returned 0 declarations." ) return mfound def decl( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): + """Finds any declaration by criteria. Please see L{scopedef_t} for full explanation.""" return self._find_single( declarations.declaration_matcher_t , name=name *************** *** 242,245 **** --- 310,314 ---- , name=name , function=function + , type=type , header_dir=header_dir , header_file=header_file *************** *** 250,253 **** --- 319,323 ---- , name=name , function=function + , type=type , header_dir=header_dir , header_file=header_file *************** *** 344,348 **** , recursive=recursive) ! def member_operator( self, name=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): return self._find_single( declarations.operator_matcher_t , name=name --- 414,418 ---- , recursive=recursive) ! def member_operator( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): return self._find_single( declarations.operator_matcher_t , name=name *************** *** 356,360 **** , recursive=recursive ) ! def member_operators( self, name=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): return self._find_multiple( declarations.operator_matcher_t , name=name --- 426,430 ---- , recursive=recursive ) ! def member_operators( self, name=None, function=None, symbol=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ): return self._find_multiple( declarations.operator_matcher_t , name=name *************** *** 398,402 **** , header_file=header_file , recursive=recursive) ! def enumerations( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): return self._find_multiple( declarations.declaration_matcher_t --- 468,474 ---- , header_file=header_file , recursive=recursive) ! #adding small aliase ! enum = enumeration ! def enumerations( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): return self._find_multiple( declarations.declaration_matcher_t *************** *** 407,409 **** , header_file=header_file , recursive=recursive) ! --- 479,482 ---- , header_file=header_file , recursive=recursive) ! #adding small aliase ! enums = enumerations Index: decl_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/decl_wrapper.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** decl_wrapper.py 29 Mar 2006 04:23:45 -0000 1.4 --- decl_wrapper.py 6 Apr 2006 06:15:59 -0000 1.5 *************** *** 4,11 **** # http://www.boost.org/LICENSE_1_0.txt) - from pygccxml import declarations - import algorithm import sys ! import logging __REPOTED_REPLACES = [] --- 4,13 ---- # http://www.boost.org/LICENSE_1_0.txt) import sys ! import algorithm ! from pyplusplus import _logging_ ! from pygccxml import declarations ! ! __REPOTED_REPLACES = [] *************** *** 16,26 **** __REPOTED_REPLACES.append( msg ) - #TODO: find better place for it - logger = logging.getLogger('pyplusplus') - __handler = logging.StreamHandler(sys.stdout) - __handler.setFormatter( logging.Formatter('%(message)s') ) - logger.addHandler(__handler) - logger.setLevel(logging.DEBUG) - class ERROR_BEHAVIOUR: PRINT = 'print' --- 18,21 ---- *************** *** 28,31 **** --- 23,35 ---- class decl_wrapper_t(object): + """Declaration interface. + + This class represents the interface to the declaration tree. Its + main purpose is to "decorate" the nodes in the tree with + information about how the binding is to be created. Instances of + this class are never created by the user, instead they are + returned by the API. + """ + def __init__(self): object.__init__(self) *************** *** 42,49 **** return self._alias elif declarations.templates.is_instantiation( self.name ): ! valid_name = self._generate_valid_name() ! #I don't think user should see this, but I could be wrong ! #report_msg_once('replacing name "%s" with "%s"' % (self.name, valid_name) ) ! return valid_name else: return self.name --- 46,50 ---- return self._alias elif declarations.templates.is_instantiation( self.name ): ! return self._generate_valid_name() else: return self.name *************** *** 51,55 **** def _set_alias(self, alias): self._alias = alias ! alias = property( _get_alias, _set_alias ) def rename( self, new_name ): --- 52,57 ---- def _set_alias(self, alias): self._alias = alias ! alias = property( _get_alias, _set_alias ! , doc="Using this property you can easily change Python name of declaration" ) def rename( self, new_name ): *************** *** 60,87 **** def _set_ignore( self, value ): self._ignore = value ! ignore = property( _get_ignore, _set_ignore ) ! def exclude( self ): self.ignore = True def include( self ): self.ignore = False #I think that almost every declaration could have some wrapper. This is the #main reason why those 3 functions does not have some well defined interface. ! def has_wrapper( self ): ! return False ! def _finalize_impl( self, error_behaviour ): ! pass ! def finalize( self, error_behaviour=None): ! try: ! self._finalize_impl( self ) ! except Exception, error: ! if None is error_behaviour or error_behaviour == ERROR_BEHAVIOUR.PRINT: ! print 'Unable to finalize declaration: ', str( error ) ! else: ! raise ! \ No newline at end of file --- 62,98 ---- def _set_ignore( self, value ): self._ignore = value ! ignore = property( _get_ignore, _set_ignore ! ,doc="If you set ignore to True then this declaration will not be exported." ) def exclude( self ): + """Exclude "self" and child declarations from being exposed.""" self.ignore = True def include( self ): + """Include "self" and child declarations to be exposed.""" self.ignore = False + #TODO: #I think that almost every declaration could have some wrapper. This is the #main reason why those 3 functions does not have some well defined interface. ! #def has_wrapper( self ): ! #return False ! #def _finalize_impl( self, error_behaviour ): ! #pass ! #def finalize( self, error_behaviour=None): ! #try: ! #self._finalize_impl( self ) ! #except Exception, error: ! #if None is error_behaviour or error_behaviour == ERROR_BEHAVIOUR.PRINT: ! #print 'Unable to finalize declaration: ', str( error ) ! #else: ! #raise ! def readme( calldef ): ! """This function will returns some hints/tips/description of problems ! that applied to the declarations. For example function that has argument ! reference to some fundamental type could be exported, but could not be called ! from Python ! """ ! return [] Index: namespace_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/namespace_wrapper.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** namespace_wrapper.py 30 Mar 2006 05:56:17 -0000 1.5 --- namespace_wrapper.py 6 Apr 2006 06:15:59 -0000 1.6 *************** *** 18,22 **** , recursive=recursive ) ! def namespaces( self, *args, **keywds ): return self._find_multiple( declarations.namespace_matcher_t , name=name --- 18,22 ---- , recursive=recursive ) ! def namespaces( self, name=None, function=None, recursive=None ): return self._find_multiple( declarations.namespace_matcher_t , name=name Index: algorithm.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/algorithm.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** algorithm.py 8 Mar 2006 09:32:52 -0000 1.3 --- algorithm.py 6 Apr 2006 06:15:59 -0000 1.4 *************** *** 10,14 **** import re - import types import pygccxml --- 10,13 ---- *************** *** 104,106 **** def _clone_impl( self ): ! return concrete_array_1_type_t( self._decl_string ) --- 103,105 ---- def _clone_impl( self ): ! return dummy_type_t( self._decl_string ) Index: calldef_wrapper.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/calldef_wrapper.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** calldef_wrapper.py 20 Mar 2006 05:47:56 -0000 1.3 --- calldef_wrapper.py 6 Apr 2006 06:15:59 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- # http://www.boost.org/LICENSE_1_0.txt) + import os import decl_wrapper from pygccxml import declarations *************** *** 23,31 **** self._create_with_signature = False ! def _get_call_policies(self): return self._call_policies ! def _set_call_policies(self, call_policies): self._call_policies = call_policies ! call_policies = property( _get_call_policies, _set_call_policies ) def _get_use_keywords(self): --- 24,32 ---- self._create_with_signature = False ! def get_call_policies(self): return self._call_policies ! def set_call_policies(self, call_policies): self._call_policies = call_policies ! call_policies = property( get_call_policies, set_call_policies ) def _get_use_keywords(self): *************** *** 66,70 **** else: pass ! class member_function_t( declarations.member_function_t, calldef_t ): def __init__(self, *arguments, **keywords): --- 67,89 ---- else: pass ! ! def readme( self ): ! def suspicious_type( type_ ): ! if not declarations.is_reference( self.return_type ): ! return False ! type_no_ref = declarations.remove_reference( type_ ) ! return not declarations.is_const( type_no_ref ) \ ! and declarations.is_fundamental( type_no_ref ) ! msg = [] ! if suspicious_type( self.return_type ) and None is self.call_policies: ! msg.append( 'WARNING: Function "%s" returns non-const reference to C++ fundamental type - value can not be modified from Python.' % str( self ) ) ! for index, arg in enumerate( self.arguments ): ! if suspicious_type( arg.type ): ! tmpl = 'WARNING: Function "%s" takes as argument (name=%s, pos=%d ) ' \ ! + 'non-const reference to C++ fundamental type - ' \ ! + 'function could not be called from Python.' ! msg.append( tmpl % ( str( self ), arg.name, index ) ) ! return msg ! class member_function_t( declarations.member_function_t, calldef_t ): def __init__(self, *arguments, **keywords): Index: decl_wrapper_printer.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/decl_wrappers/decl_wrapper_printer.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** decl_wrapper_printer.py 6 Mar 2006 05:00:33 -0000 1.1 --- decl_wrapper_printer.py 6 Apr 2006 06:15:59 -0000 1.2 *************** *** 26,33 **** if not self.print_details: return ! self.writer( ' ' * (self.level+1) * self.INDENT_SIZE ! + "Alias: " + self.instance.alias + os.linesep ) ! self.writer( ' ' * (self.level+1) * self.INDENT_SIZE ! + "Ignore: " + str( self.instance.ignore ) + os.linesep ) def print_calldef_wrapper(self): --- 26,39 ---- if not self.print_details: return ! intend_txt = ' ' * (self.level+1) * self.INDENT_SIZE ! self.writer( intend_txt + "Alias: " + self.instance.alias + os.linesep ) ! self.writer( intend_txt + "Ignore: " + str( self.instance.ignore ) + os.linesep ) ! if not self.instance.ignore: ! msgs = self.instance.readme() ! if msgs: ! self.writer( intend_txt + "ReadMe: " + os.linesep ) ! more_intend_txt = ' ' * (self.level+2) * self.INDENT_SIZE ! for msg in msgs: ! self.writer( more_intend_txt + msg + os.linesep ) def print_calldef_wrapper(self): |
From: Roman <rom...@us...> - 2006-04-06 06:16:45
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/custom_code_creator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/examples/custom_code_creator Modified Files: environment.py sconstruct Removed Files: create_bindings.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: sconstruct =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/custom_code_creator/sconstruct,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sconstruct 29 Nov 2005 07:39:57 -0000 1.2 --- sconstruct 6 Apr 2006 06:16:02 -0000 1.3 *************** *** 25,29 **** SharedLibrary( target=get_target() ! , source=[ 'generated/pysources.cpp' ] , LIBS=[ 'boost_python', ] , LIBPATH=[ settings.boost_libs_path, settings.python_libs_path ] --- 25,29 ---- SharedLibrary( target=get_target() ! , source=[ 'generated/properties.py.cpp' ] , LIBS=[ 'boost_python', ] , LIBPATH=[ settings.boost_libs_path, settings.python_libs_path ] Index: environment.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/custom_code_creator/environment.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** environment.py 29 Nov 2005 07:39:57 -0000 1.2 --- environment.py 6 Apr 2006 06:16:00 -0000 1.3 *************** *** 8,12 **** class settings: ! module_name = 'pysources' boost_path = '' boost_libs_path = '' --- 8,12 ---- class settings: ! module_name = 'properties' boost_path = '' boost_libs_path = '' *************** *** 34,38 **** settings.python_include_path = '/usr/include/python2.3' ! settings.sources_path = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/sources' settings.working_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' settings.generated_files_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/generated' --- 34,38 ---- settings.python_include_path = '/usr/include/python2.3' ! settings.sources_path = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' settings.working_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' settings.generated_files_dir = '/home/roman/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/generated' *************** *** 47,51 **** settings.python_include_path = 'c:/python/include' ! settings.sources_path = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/sources' settings.working_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' settings.generated_files_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/generated' --- 47,51 ---- settings.python_include_path = 'c:/python/include' ! settings.sources_path = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' settings.working_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator' settings.generated_files_dir = 'd:/pygccxml_sources/source/pyplusplus/examples/custom_code_creator/generated' --- create_bindings.py DELETED --- |
From: Roman <rom...@us...> - 2006-04-06 06:16:45
|
Update of /cvsroot/pygccxml/source/pygccxml/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pygccxml/docs Modified Files: default.css download.rest example.py generate_docs.py pkg-info.txt pygccxml.rest 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: download.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/download.rest,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** download.rest 24 Jan 2006 05:46:27 -0000 1.1 --- download.rest 6 Apr 2006 06:15:57 -0000 1.2 *************** *** 49,64 **** * `Docutils`_ - only in case you want to create\\extend current documentation - -------------------------------------------------------------------------------- - - Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 - .. _`pygccxml` : ./../pygccxml/pygccxml.html .. _`SourceForge`: http://sourceforge.net/index.php --- 49,52 ---- Index: example.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/example.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** example.py 2 May 2005 03:31:05 -0000 1.5 --- example.py 6 Apr 2006 06:15:57 -0000 1.6 *************** *** 1,19 **** ! # Copyright 2004 Roman Yakovenko. ! # Distributed under the Boost Software License, Version 1.0. (See ! # accompanying file LICENSE_1_0.txt or copy at ! # http://www.boost.org/LICENSE_1_0.txt) ! ! #This example assumes that you have gccxml in your path. ! ! import os ! import sys ! import pygccxml ! ! config = pygccxml.parser.config_t( gccxml_path=r'c:/tools/gcc_xml' ) ! namespaces = pygccxml.parser.parse( ['core_class_hierarchy.hpp'], config ) ! all_declarations = pygccxml.declarations.make_flatten(namespaces) ! for decl in all_declarations: ! print decl.__class__.__name__, ' : ', decl.name ! if isinstance( decl, pygccxml.declarations.class_t ): ! print '\tbases: ', `[base.related_class.name for base in decl.bases]` ! print '\tderived: ', `[derive.related_class.name for derive in decl.derived]` --- 1,23 ---- ! # Copyright 2004 Roman Yakovenko. ! # Distributed under the Boost Software License, Version 1.0. (See ! # accompanying file LICENSE_1_0.txt or copy at ! # http://www.boost.org/LICENSE_1_0.txt) ! ! from pygccxml import parser ! from pygccxml import declarations ! ! #configure GCC-XML parser ! config = parser.config_t( gccxml_path=r'/home/roman/gccxml/bin/gccxml' ) ! #parsing source file ! global_ns = parser.parse( ['core_class_hierarchy.hpp'], config ) ! #printing all declarations found in file and its includes ! declarations.print_declarations( global_ns ) ! #selecting all classes ! all_decls = declarations.make_flatten( global_ns ) ! all_classes = filter( lambda decl: isinstance( decl, declarations.class_t ) ! , all_decls ) ! #print all base and derived class names ! for class_ in all_classes: ! print class_.name ! print '\tbases: ', `[base.related_class.name for base in class_.bases]` ! print '\tderived: ', `[derive.related_class.name for derive in class_.derived]` Index: generate_docs.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/generate_docs.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** generate_docs.py 16 Jan 2006 05:59:45 -0000 1.33 --- generate_docs.py 6 Apr 2006 06:15:57 -0000 1.34 *************** *** 8,11 **** --- 8,30 ---- from docutils.core import publish_file + packages = [ "declarations" + , "parser" + , "utils" + , "__init__.py" ] + + def run_epydoc( source_dir, destination_dir ): + global packages + pygccxml_dir = os.path.join( source_dir, '../../pygccxml' ) + packages = map( lambda package: '"%s"' % os.path.join( pygccxml_dir, package ), packages ) + + options = [ '--output "%s" ' % os.path.join( destination_dir, 'auto_docs' ) + , '--docformat epytext' + , '--url http://www.language-binding.net' + , '--css default.css' + , '--name pygccxml' + , ' '.join( packages ) ] + cmd_line = "epydoc " + ' '.join( options ) + os.system(cmd_line) + def generate( source_dir, destination_dir ): publish_file( source_path=os.path.join( source_dir, 'pygccxml.rest' ) *************** *** 16,19 **** --- 35,39 ---- shutil.copyfile( os.path.join( source_dir, f ) , os.path.join( destination_dir, f ) ) + run_epydoc( source_dir, destination_dir ) if __name__ == '__main__': Index: pkg-info.txt =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/pkg-info.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pkg-info.txt 29 Dec 2005 06:10:17 -0000 1.1 --- pkg-info.txt 6 Apr 2006 06:15:57 -0000 1.2 *************** *** 1,5 **** Metadata-Version: 1.1 Name: pygccxml ! Version: 0.6.9 Author: Roman Yakovenko Author-email: roman yakovenko at gmail com --- 1,5 ---- Metadata-Version: 1.1 Name: pygccxml ! Version: 0.7.1 Author: Roman Yakovenko Author-email: roman yakovenko at gmail com Index: pygccxml.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/pygccxml.rest,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pygccxml.rest 13 Mar 2006 09:22:00 -0000 1.5 --- pygccxml.rest 6 Apr 2006 06:15:57 -0000 1.6 *************** *** 12,24 **** , опиÑание, опÑеделение, иеÑаÑÑ Ð¸Ñ ÐºÐ»Ð°ÑÑов, генеÑаÑÐ¾Ñ ÐºÐ¾Ð´Ð° ! -------------- ! Introduction ! -------------- ! .. include:: ./definition.rest ! I'd like to see an example ! -------------------------- First of all let's see a small and simple `example`_. This example prints all declarations found in the `core_class_hierarchy.hpp`_ file. Also, for instances --- 12,39 ---- , опиÑание, опÑеделение, иеÑаÑÑ Ð¸Ñ ÐºÐ»Ð°ÑÑов, генеÑаÑÐ¾Ñ ÐºÐ¾Ð´Ð° ! ------------ ! Introduction ! ------------ .. include:: ./definition.rest ! ---------------------- ! What can I do with it? ! ---------------------- ! Using `pygccxml`_ you can: ! ! * parse C++ source code ! * build a code generator ! ! + `pyplusplus`_ is havily based on `pygccxml`_ ! + generate `WSDL`_ file from sources ! + ... + * create UML diagrams + * build code analizer + * ... + + ------------- + Usage example + ------------- First of all let's see a small and simple `example`_. This example prints all declarations found in the `core_class_hierarchy.hpp`_ file. Also, for instances *************** *** 293,325 **** strategy. ! --------- ! Thanks to ! --------- ! ! * My wife Yulia - she helped me to edit the initial version of this manuals. All ! mistakes and bugs are mine. I'd like to believe that I know `Python`_ better ! then English. ! ! * Brad King for `GCC-XML`_ ! ! * Detlev Offenbach for `Eric 3.6`_ ! ! * `Docutils`_ - easy to use documentation system ! ! * Phil Schwartz - `ReleaseForge`_ - easiest way to release your product on ! `SourceForge`_ ! ! * John Pallister <jo...@sy...> - he helped me to edit\\correct documentation ! ! * Hosted by |SourceForge|__ ! ! __ http://sourceforge.net/ ! .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 ! :alt: SourceForge.net Logo ! :align: middle ! :width: 125 ! :height: 37 ! .. :border: 0 ! .. _`pygccxml`: ./pygccxml.html .. _`SourceForge`: http://sourceforge.net/index.php --- 308,313 ---- strategy. ! .. _`WSDL`: http://www.w3.org/TR/wsdl ! .. _`pyplusplus`: ./../pyplusplus/pyplusplus.html .. _`pygccxml`: ./pygccxml.html .. _`SourceForge`: http://sourceforge.net/index.php *************** *** 328,332 **** .. _`GCC-XML`: http://www.gccxml.org .. _`Boost Software License`: http://boost.org/more/license_info.html - .. _`Eric 3.6`: http://www.die-offenbachs.de/detlev/eric3.html .. _`Debian Linux`: http://www.debian.org .. _`UML diagram` : ./declarations.png --- 316,319 ---- Index: default.css =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/default.css,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** default.css 27 Oct 2005 05:31:57 -0000 1.4 --- default.css 6 Apr 2006 06:15:57 -0000 1.5 *************** *** 1,327 **** ! /* ! :Authors: David Goodger, David Abrahams ! :Contact: go...@us..., da...@bo... ! :date: $Date$ ! :version: $Revision$ ! :copyright: This stylesheet has been placed in the public domain. ! ! This stylesheet is for the use of ReStructuredText in a Boost context. ! It is basically an agglomeration of boost.css and the default.css that ! comes from docutils. ! ! */ ! ! .first { ! margin-top: 0 } ! ! .last { ! margin-bottom: 0 } ! ! a.toc-backref { ! text-decoration: none ; ! color: black } ! ! dd { ! margin-bottom: 0.5em } ! ! div.abstract { ! margin: 2em 5em } ! ! div.abstract p.topic-title { ! font-weight: bold ; ! text-align: center } ! ! div.attention, div.caution, div.danger, div.error, div.hint, ! div.important, div.note, div.tip, div.warning, div.admonition { ! margin: 2em ; ! border: medium outset ; ! padding: 1em } ! ! div.attention p.admonition-title, div.caution p.admonition-title, ! div.danger p.admonition-title, div.error p.admonition-title, ! div.warning p.admonition-title { ! color: red ; ! font-weight: bold ; ! font-family: sans-serif } ! ! div.hint p.admonition-title, div.important p.admonition-title, ! div.note p.admonition-title, div.tip p.admonition-title, ! div.admonition p.admonition-title { ! font-weight: bold ; ! font-family: sans-serif } ! ! div.dedication { ! margin: 2em 5em ; ! text-align: center ; ! font-style: italic } ! ! div.dedication p.topic-title { ! font-weight: bold ; ! font-style: normal } ! ! div.figure { ! margin-left: 2em } ! ! div.footer, div.header { ! font-size: smaller } ! ! div.line-block { display: block } ! div.line-block div.line-block { margin-left: 1.5em } ! ! div.sidebar { ! margin-left: 1em ; ! border: medium outset ; ! padding: 0em 1em ; ! background-color: #ffffee ; ! width: 40% ; ! float: right ; ! clear: right } ! ! div.sidebar p.rubric { ! font-family: sans-serif ; ! font-size: medium } ! ! div.system-messages { ! margin: 5em } ! ! div.system-messages h1 { ! color: red } ! ! div.system-message { ! border: medium outset ; ! padding: 1em } ! ! div.system-message p.system-message-title { ! color: red ; ! font-weight: bold } ! ! div.topic { ! margin: 2em } ! ! dt { ! font-weight: bold ! } ! ! H1.title ! { ! FONT-SIZE: 200%; ! COLOR: #00008B; ! text-align: center ! } ! H1 ! { ! FONT-SIZE: 150%; ! } ! H2 ! { ! FONT-SIZE: 125%; ! } ! h2.subtitle { ! text-align: center } ! H3 ! { ! FONT-SIZE: 108%; ! } ! BODY ! { ! FONT-SIZE: 100%; ! BACKGROUND-COLOR: #ffffff; ! } ! PRE ! { ! MARGIN-LEFT: 2em; ! FONT-FAMILY: Courier; ! } ! CODE ! { ! FONT-FAMILY: Courier; ! white-space: pre; ! } ! .pre ! { ! FONT-FAMILY: Courier; ! white-space: pre; ! } ! .index ! { ! TEXT-ALIGN: left; ! } ! .page-index ! { ! TEXT-ALIGN: left; ! } ! .definition ! { ! TEXT-ALIGN: left; ! } ! .footnote ! { ! FONT-SIZE: 80%; ! VERTICAL-ALIGN: super; ! TEXT-DECORATION: none; ! } ! .function-semantics ! { ! CLEAR: left; } ! hr { ! width: 75% } ! ! ol.simple, ul.simple { ! margin-bottom: 1em } ! ! ol.arabic { ! list-style: decimal } ! ! ol.loweralpha { ! list-style: lower-alpha } ! ! ol.upperalpha { ! list-style: upper-alpha } ! ! ol.lowerroman { ! list-style: lower-roman } ! ! ol.upperroman { ! list-style: upper-roman } ! ! p.attribution { ! text-align: right ; ! margin-left: 50% } ! ! p.caption { ! font-style: italic } ! ! p.credits { ! font-style: italic ; ! font-size: smaller } ! ! p.label { ! white-space: nowrap } ! ! p.rubric { ! font-weight: bold ; ! font-size: larger ; ! color: maroon ; ! text-align: center } ! ! p.sidebar-title { ! font-family: sans-serif ; ! font-weight: bold ; ! font-size: larger } ! ! p.sidebar-subtitle { ! font-family: sans-serif ; ! font-weight: bold } ! ! p.topic-title { ! font-weight: bold } ! ! pre.address { ! margin-bottom: 0 ; ! margin-top: 0 ; ! font-family: serif ; ! font-size: 100% } ! ! pre.line-block { ! font-family: serif ; ! font-size: 100% } ! ! pre.literal-block, pre.doctest-block { ! margin-left: 2em ; ! margin-right: 2em ; ! background-color: #eeeeee } ! span.class { ! font-family: monospace; } ! span.classifier { ! font-family: sans-serif ; ! font-style: oblique } ! ! span.classifier-delimiter { ! font-family: sans-serif ; ! font-weight: bold } ! ! span.doublesize { ! font-size: 200% } ! span.interpreted { ! font-family: sans-serif } ! ! span.concept { ! font-family: sans-serif } ! ! span.function { ! font-family: monospace; } ! span.option { ! white-space: nowrap } ! ! span.option-argument { ! font-style: italic } ! ! span.pre { ! white-space: pre } ! ! span.problematic { ! color: red } ! ! /* Firefox, at least, seems to need some help lowering ! subscripts. Without the following, subscripts seem not to drop ! at all when in a preformatted block. -- DWA ! */ ! ! sub { ! vertical-align: -20% } ! table { ! margin-top: 0.5em ; ! margin-bottom: 0.5em } ! ! table.citation { ! border-left: solid thin gray ; ! padding-left: 0.5ex } ! ! table.docinfo { ! margin: 2em 4em } ! ! table.footnote { ! border-left: solid thin black ; ! padding-left: 0.5ex } ! ! td, th { ! padding-left: 0.5em ; ! padding-right: 0.5em ; ! vertical-align: top } ! ! th.docinfo-name, th.field-name { ! font-weight: bold ; ! text-align: left ; ! white-space: nowrap } ! ! /* ! dwa 2003/7/29 -- commented out so that it wouldn't override earlier ! styles from boost.css ! ! h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { ! font-size: 100% } ! */ ! ! ul.auto-toc { ! list-style-type: none } ! ! img.boost-logo { ! border: none; ! vertical-align: middle } ! pre.literal-block span.concept { ! font-style: italic; ! } --- 1,42 ---- ! h1{ ! font-size: 120%; ! text-align: left; } ! caption { font-weight: bold } ! div.block { ! border: 1px solid #84b0c7; ! text-align: left; ! margin: 5px; ! margin-bottom: 10px; ! padding: 2px; } ! div.block ul { ! margin-top: 10px; ! margin-bottom: 10px; } ! div.title { ! border: 1px solid #84b0c7; ! text-align: center; ! margin: 2px; ! padding: 2px; } ! div.section h2{ ! text-decoration: none; ! font-size: 100%; } ! a.reference { ! color: #1a419d; ! text-align: right; } ! a{ color: #1a419d } + a:visited{ color: #1a419d } + + a:hover{ background-color: #ddddff } |
From: Roman <rom...@us...> - 2006-04-06 06:16:45
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/custom_code_creator/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/examples/custom_code_creator/unittests Modified Files: test_all.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: test_all.py =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/examples/custom_code_creator/unittests/test_all.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_all.py 13 Nov 2005 08:35:44 -0000 1.1 --- test_all.py 6 Apr 2006 06:16:05 -0000 1.2 *************** *** 1,4 **** import unittest ! import pysources class tester_t( unittest.TestCase ): --- 1,4 ---- import unittest ! import properties class tester_t( unittest.TestCase ): *************** *** 7,17 **** def test(self): ! point = pysources.point_t() self.failUnless( point.x == 0 ) self.failUnless( point.y == 0 ) point.x = 24 point.y = 18 ! self.failUnless( pysources.get_x( point ) == 24 ) ! self.failUnless( pysources.get_y( point ) == 18 ) def create_suite(): --- 7,17 ---- def test(self): ! point = properties.point_t() self.failUnless( point.x == 0 ) self.failUnless( point.y == 0 ) point.x = 24 point.y = 18 ! self.failUnless( properties.extract_x( point ) == 24 ) ! self.failUnless( properties.extract_y( point ) == 18 ) def create_suite(): |
From: Roman <rom...@us...> - 2006-04-06 06:16:45
|
Update of /cvsroot/pygccxml/source/pyplusplus/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/docs Modified Files: download.rest pyplusplus.rest Removed Files: filters.txt tutorials.rest 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: pyplusplus.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/docs/pyplusplus.rest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pyplusplus.rest 24 Jan 2006 05:46:28 -0000 1.4 --- pyplusplus.rest 6 Apr 2006 06:15:59 -0000 1.5 *************** *** 10,14 **** .. include:: ./definition.rest ! ----------------------- Code generation process --- 10,22 ---- .. include:: ./definition.rest ! ! -------- ! Preamble ! -------- ! ! This introduction will describe code generation process using `pyplusplus`_. ! I hope, that after you finished to read it, you will understand how powerful ! `pyplusplus`_. ! ----------------------- Code generation process *************** *** 22,102 **** ! Next few paragraphs will explain more about every step and what ! customization\\configuration can be done. *"read declarations"* --------------------- ! In order to provide maximum flexibility `pyplusplus`_ does not involved in this ! step at all :-). As you can see, from the process definition, you can read ! declarations from few sources: ! ! * source files - see `pygccxml`_ framework - * xml files - see `pygccxml`_ framework ! * other, for example Microsoft "bsc" files - not implemented yet ! ! Using `pygccxml`_ as declarations reader introduce a small problem. It reads all ! declarations, even those that you do not need. Those unneeded declarations ! could be filtered out. For example *"details"* namespace. It is a common ! practice to put the implementation details into *"details"* namespace. ! Declarations that belong to the *"details"* namespace can be removed. ! ! *"create module"* ----------------- ! `pyplusplus`_ introduces new concept: code creator and code creator's tree. The easiest ! way to explain what is the code creator concept is with example. *include_t* code ! creator is responsible to create code for C++ include directive. Module is the ! top level code creator. It keeps code creator's tree. I can make next analogy ! between code creators concept and XML: ! * code creators <==> Nodes ! * code creators tree <==> XML DOM ! * module <==> DOM Document ! Here you can find UML diagram of all code creators: `class diagram`_. ! .. _`class diagram`: ./code_creators.png ! What is the main role of this step? The main role of this step is to create ! module that keeps code creators tree. It is not as simple as it seems from ! the first sight. Here are few examples: ! 1. Some declarations mapped to more then one code creator. For example for ! C++ class there are more then 2 code creators: *wrapper* and *class_*. ! 2. Base class should be exposed before it's derived classes. ! 3. Type of variable should be exposed before the variable itself. ! I can continue the list of examples, but I think you've got the idea. Mapping, ! between declarations and code creators, implemented by `pyplusplus`_ should be ! good enough for most user. If your case is different, then you can customize ! this step or even implement your own one, using build-in functionality as basis ! for your implementation. To be flexible and expendable, this is one of the goals ! of `pyplusplus`_. Before writing code to files, there is an opportunity to ! change\\customize a lot of things: ! ! * adding custom code creators, this means user code can be placed almost ! any where - * adding namespace aliases, using declarations - - * finalizing "wrappers" of classes/functions - - * renaming exposed declarations - - * changing the structure of code creators tree - - *"write code to files"* ----------------------- ! ! The result of code generation process should not be different from the ! one, that would be achieved by human. For small project single file will ! be good. For big projects multiple files are required. `pyplusplus`_ implements ! both strategies. ------------- --- 30,114 ---- ! Next few paragraphs will explain more about every step. *"read declarations"* --------------------- ! `pyplusplus`_ uses `pygccxml`_ to read all declaration from source files. ! *"build module"* ----------------- ! Only very small and simple projects could be exported as is. Most of the projects ! still require human invocation. Basically there are 2 questions that an user ! should answer: ! 1. which declarations should be exported ! 2. how this specific declaration should be exported ! Of course `pyplusplus`_ can not answer those question, but it provides maximum ! help for the developer to implement/translate an user requirements to code. So ! what help a developer get from `pyplusplus`_ in order to deal with first question? ! `pyplusplus`_ provides very powerful query interface. ! For example in one line of code you can select all free functions that have ! two arguments, where first one is ``int &`` and second one is any: ! :: ! mb = module_builder_t( ... ) #module_builder_t is the main class that ! #will help you with code generation process ! mb.free_functions( arg_types=[ 'int &', None ] ) ! An other example - the developer wants to exclude all protected functions from ! being exported: ! :: ! mb = module_builder_t( ... ) ! mb.calldefs( access_type_matcher_t( 'protected' ) ).exclude() ! The developer can create custom criteria, for example exclude all declarations ! that have 'impl' ( implementation ) string within the name. ! :: ! mb = module_builder_t( ... ) ! mb.decls( lambda decl: 'impl' in decl.name ).exclude() ! ! Okay, enough with code. If you want to read more code please read the tutorials. ! I am sure you already noted some interesting detail: all queries does not specify ! declaration name. It is possible, but still, why I did not? Because this form ! allows you to setup few rules, that will continue to work even after C++ has ! been changed. Thus you don't have to modify code generator source code, every ! time exported C++ code was changed. ! ! So far, so good what about second question? Well, by default `pyplusplus`_ ! generates a code that will satisfy almost all developers. But sometimes a developer ! need to modify generated code. `pyplusplus`_ relevant classes could be configured ! in many ways. But sometimes this is still not enough. Sometimes a developer need ! full control over generated code. One of the bigest problems, that I believe ! `pyplusplus`_ solved, is modifying generated code. How many code generators did ! you use, that allow you to put your code any where, to reorder generated code as ! you wish? `pyplusplus`_ allows you to do that. ! ! `pyplusplus`_ introduces new concept: code creator and code creator's tree. ! Code creator responsibility is to create small well defined piece of code. ! For example *include_t* code creator is responsible to create code for C++ ! include directive. Code creators tree is an ordered set of code creators. ! Some of code creators can contain others. Module is the top level code creator. ! A developer is able to add, delete or modify single/group of code creators. ! Here you can find UML diagram of almost all code creators: `class diagram`_. ! ! .. _`class diagram`: ./code_creators.png ! ! At the end of this step you have code creators tree, that is ready to be written ! to disc. *"write code to files"* ----------------------- ! During this step `pyplusplus`_ reads code creators tree and writes code to the ! disc.The result of code generation process should not be different from the one, ! that would be achieved by human. For small project writing all code into single ! file is good approach, for big ones code should be written into multiple files. ! `pyplusplus`_ implements both strategies. ------------- *************** *** 164,203 **** `Boost Software License`_. - - ------------------------------------ - Structure of `pyplusplus`_ framework - ------------------------------------ - - `pyplusplus`_ is separated to 5 different packages: - - 1. Code creators package. The only responsibility of classes in this - package is to create code. Those classes do not care where code is - going to be written. Neither they care about the order of generated - code. - - 2. Module creator package. This is code creators factory. Classes in this - package analyze C++ declarations and creates relevant code creators. - - 3. File writers package. This package contains classes that write - generated code to file(s). - - 4. Unit tests - right now there are more then 20 unit tests. `pyplusplus`_ - package generated code tested under Windows XP + msvc 7.1 and under - Debian 3.1 + GCC 3.3.5. - - 5. Real world examples. - -------------------------------------------------------------------------------- - - Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 - .. _`pyplusplus` : ./pyplusplus.html .. _`pygccxml` : ./../pygccxml/pygccxml.html --- 176,180 ---- --- filters.txt DELETED --- --- tutorials.rest DELETED --- Index: download.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/docs/download.rest,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** download.rest 23 Jan 2006 06:36:30 -0000 1.1 --- download.rest 6 Apr 2006 06:15:59 -0000 1.2 *************** *** 53,68 **** * `Docutils`_ - only in case you want to create\\extend current documentation - -------------------------------------------------------------------------------- - - Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 - .. _`pyplusplus` : ./pyplusplus.html .. _`pygccxml` : ./../pygccxml/pygccxml.html --- 53,56 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:43
|
Update of /cvsroot/pygccxml/source/pyplusplus/docs/comparisons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/docs/comparisons Modified Files: pyste.rest 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: pyste.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/docs/comparisons/pyste.rest,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyste.rest 16 Jan 2006 05:59:48 -0000 1.1 --- pyste.rest 6 Apr 2006 06:15:59 -0000 1.2 *************** *** 407,422 **** of time and motivation prevents him to work on `Pyste`_. - ------------------- - - Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 - .. _`screenshot` : ./../pyplusplus_demo.png .. _`pyplusplus` : ./../pyplusplus.html --- 407,410 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:43
|
Update of /cvsroot/pygccxml/source/pyplusplus/docs/history In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/docs/history Modified Files: history.rest 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: history.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/docs/history/history.rest,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** history.rest 1 Feb 2006 07:31:42 -0000 1.9 --- history.rest 6 Apr 2006 06:16:00 -0000 1.10 *************** *** 93,107 **** 3. Few bug fixes - -------------------------------------------------------------------------------- - - Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 .. _`pyplusplus` : ./../pyplusplus.html --- 93,96 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:43
|
Update of /cvsroot/pygccxml/source/pygccxml/unittests/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pygccxml/unittests/data Modified Files: core_cache.hpp 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: core_cache.hpp =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/data/core_cache.hpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** core_cache.hpp 30 Mar 2006 05:56:17 -0000 1.50 --- core_cache.hpp 6 Apr 2006 06:15:58 -0000 1.51 *************** *** 24,26 **** ! //touch//touch//touch//touch \ No newline at end of file --- 24,26 ---- ! //touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch//touch \ No newline at end of file |
From: Roman <rom...@us...> - 2006-04-06 06:16:41
|
Update of /cvsroot/pygccxml/source/pyplusplus/docs/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/docs/examples Modified Files: examples.rest 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: examples.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pyplusplus/docs/examples/examples.rest,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** examples.rest 23 Jan 2006 06:36:28 -0000 1.3 --- examples.rest 6 Apr 2006 06:15:59 -0000 1.4 *************** *** 35,40 **** * "custom_code_creator" - exports get\\set functions as class properties - - * `py_qtxml`_ - exports whole `Qt.QtXml`_ module * `py_easybmp`_ - exports `EasyBMP`_ library --- 35,38 ---- *************** *** 46,52 **** .. _`boost.python`: http://www.boost.org/libs/python/doc/index.html .. _`pyplusplus` : ./../pyplusplus.html - .. _`Qt.QtXml` : http://doc.trolltech.com/4.0/qtxml.html#qtxml .. _`boost.date_time` : http://www.boost.org - .. _`py_qtxml` : ./qtxml/qtxml.html .. _`py_easybmp` : ./easybmp/easybmp.html .. _`py_date_time` : ./date_time/date_time.html --- 44,48 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:40
|
Update of /cvsroot/pygccxml/source/pygccxml/docs/history In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pygccxml/docs/history Modified Files: history.rest 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: history.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/docs/history/history.rest,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** history.rest 20 Mar 2006 06:41:19 -0000 1.6 --- history.rest 6 Apr 2006 06:15:57 -0000 1.7 *************** *** 5,11 **** .. contents:: Table of contents ! ----------- ! CVS Version ! ----------- 1. New fundamental types has been added --- 5,25 ---- .. contents:: Table of contents ! ------------ ! Contributors ! ------------ ! ! Thanks to all the people that have contributed patches, bug reports and suggestions. ! Source code and documentation have been contributed by ! ! * My wife - Yulia ! * John Pallister <jo...@sy...> ! * Matthias Baas ! * Allen Bierbaum ! ! ------------- ! Version 0.7.1 ! ------------- ! ! **Attention - this going to be last version that is tested with Python 2.3** 1. New fundamental types has been added *************** *** 165,179 **** `pygccxml`_ replaces *"restricted"* with *"volatile"*. - -------------------------------------------------------------------------------- - - * Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 .. _`pygccxml`: ./../pygccxml.html --- 179,182 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:40
|
Update of /cvsroot/pygccxml/source/pygccxml/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pygccxml/unittests Modified Files: autoconfig.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: autoconfig.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/unittests/autoconfig.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** autoconfig.py 22 Mar 2006 11:08:11 -0000 1.13 --- autoconfig.py 6 Apr 2006 06:15:58 -0000 1.14 *************** *** 7,10 **** --- 7,13 ---- import sys + #__pychecker__ = 'limit=1000' + #import pychecker.checker + data_directory = '' gccxml_path = '' *************** *** 74,77 **** --- 77,81 ---- , 'gccxml'#parameter description , 'pyplusplus' + , 'pygccxml' ] ) except ImportError: |
From: Roman <rom...@us...> - 2006-04-06 06:16:33
|
Update of /cvsroot/pygccxml/source/pydsc/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pydsc/docs Modified Files: pydsc.rest 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: pydsc.rest =================================================================== RCS file: /cvsroot/pygccxml/source/pydsc/docs/pydsc.rest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pydsc.rest 31 Jan 2006 08:15:51 -0000 1.4 --- pydsc.rest 6 Apr 2006 06:15:55 -0000 1.5 *************** *** 63,79 **** http://sourceforge.net/project/showfiles.php?group_id=118209 - -------------------------------------------------------------------------------- - - Hosted by |SourceForge|__ - - __ http://sourceforge.net/ - .. |SourceForge| image:: http://sourceforge.net/sflogo.php?group_id=118209&type=4 - :alt: SourceForge.net Logo - :align: middle - :width: 125 - :height: 37 - .. :border: 0 - - -------------------------------------------------------------------------------- .. _`pydsc`: ./pydsc.html --- 63,66 ---- |
From: Roman <rom...@us...> - 2006-04-06 06:16:24
|
Update of /cvsroot/pygccxml/source/pyplusplus/_logging_ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/_logging_ Added Files: __init__.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. --- NEW FILE: __init__.py --- # Copyright 2004 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) #TODO: find better place for it import sys import logging logger = logging.getLogger('pyplusplus') __handler = logging.StreamHandler(sys.stdout) __handler.setFormatter( logging.Formatter('%(message)s') ) logger.addHandler(__handler) logger.setLevel(logging.DEBUG) |
From: Roman <rom...@us...> - 2006-04-06 06:16:23
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/custom_code_creator/generated In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/examples/custom_code_creator/generated Added Files: place_holder Removed Files: pysources.cpp 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. --- NEW FILE: place_holder --- --- pysources.cpp DELETED --- |
From: Roman <rom...@us...> - 2006-04-06 06:16:19
|
Update of /cvsroot/pygccxml/source/pyplusplus/examples/py_easybmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28954/pyplusplus/examples/py_easybmp Removed Files: create_easybmp.py create_package.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. --- create_package.py DELETED --- --- create_easybmp.py DELETED --- |