[pygccxml-commit] source/pygccxml/declarations filters.py,1.6,1.7
Brought to you by:
mbaas,
roman_yakovenko
From: Roman <rom...@us...> - 2006-03-30 05:56:28
|
Update of /cvsroot/pygccxml/source/pygccxml/declarations In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28510/pygccxml/declarations Modified Files: filters.py Log Message: fixing select API to be more user friendly Index: filters.py =================================================================== RCS file: /cvsroot/pygccxml/source/pygccxml/declarations/filters.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filters.py 29 Mar 2006 04:14:50 -0000 1.6 --- filters.py 30 Mar 2006 05:56:16 -0000 1.7 *************** *** 86,90 **** class declaration_matcher_t( matcher_base_t ): ! def __init__( self, **keywds ): """ Instance of this class will match declarations by next criteria: declaration type - any class that derives from L{pygccxml.declarations.declaration_t} class --- 86,90 ---- 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 *************** *** 99,108 **** declaration name only. ! @param keywds: could contain only next keys: ! decl_type ! name ! header_dir ! header_file ! """ #An other option is that --- 99,106 ---- 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 *************** *** 111,115 **** #cwd and this behaviour is fragile and not so easy to find the bug. matcher_base_t.__init__( self ) ! self.decl_type = keywds.get('decl_type', None) self.__name = None self.__opt_is_tmpl_inst = None --- 109,113 ---- #cwd and this behaviour is fragile and not so easy to find the bug. matcher_base_t.__init__( self ) ! self.decl_type = decl_type self.__name = None self.__opt_is_tmpl_inst = None *************** *** 118,125 **** self.__decl_name_only = None ! self._set_name( keywds.get('name', None) ) ! self.header_dir = keywds.get('header_dir', None) ! self.header_file = keywds.get('header_file', None) if self.header_dir: --- 116,123 ---- self.__decl_name_only = None ! self._set_name( name ) ! self.header_dir = header_dir ! self.header_file = header_file if self.header_dir: *************** *** 224,234 **** class variable_matcher_t( declaration_matcher_t ): ! def __init__( self, **keywds ): """ type could be string or instance of class derived from cpptypes.type_t """ ! keywds['decl_type'] = variable.variable_t ! declaration_matcher_t.__init__( self, **keywds ) ! self.type = keywds.get('type', None) def __call__( self, decl ): --- 222,235 ---- 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 ! , name=name ! , decl_type=variable.variable_t ! , header_dir=header_dir ! , header_file=header_file ) ! self.type = type def __call__( self, decl ): *************** *** 256,262 **** class namespace_matcher_t( declaration_matcher_t ): ! def __init__( self, **keywds ): ! keywds['decl_type'] = namespace.namespace_t ! declaration_matcher_t.__init__( self, **keywds) def __call__( self, decl ): --- 257,262 ---- class namespace_matcher_t( declaration_matcher_t ): ! def __init__( self, name=None ): ! declaration_matcher_t.__init__( self, name=name, decl_type=namespace.namespace_t) def __call__( self, decl ): *************** *** 265,269 **** class calldef_matcher_t( declaration_matcher_t ): ! def __init__( self, **keywds): """Constructor. --- 265,269 ---- 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. *************** *** 277,286 **** default argument value and/or exception .... """ ! if not keywds.has_key( 'decl_type' ): ! keywds[ 'decl_type' ] = calldef.calldef_t ! declaration_matcher_t.__init__( self, **keywds ) ! self.return_type = keywds.get( 'return_type', None ) ! self.arg_types = keywds.get( 'arg_types', None ) def __call__( self, decl ): --- 277,290 ---- default argument value and/or exception .... """ ! if None is decl_type: ! decl_type = calldef.calldef_t ! declaration_matcher_t.__init__( self ! , name=name ! , decl_type=decl_type ! , header_dir=header_dir ! , header_file=header_file ) ! self.return_type = return_type ! self.arg_types = arg_types def __call__( self, decl ): *************** *** 330,343 **** class operator_matcher_t( calldef_matcher_t ): ! def __init__( self, **keywds): ! if not keywds.has_key( 'decl_type' ): ! keywds['decl_type'] = calldef.operator_t ! calldef_matcher_t.__init__( self, **keywds ) ! self.symbol = keywds.get( 'symbol', None ) def __call__( self, decl ): if not super( operator_matcher_t, self ).__call__( decl ): return False ! return None != self.symbol and self.symbol == decl.symbol def __str__( self ): --- 334,356 ---- class operator_matcher_t( calldef_matcher_t ): ! def __init__( self, name=None, symbol=None, return_type=None, arg_types=None, decl_type=None, header_dir=None, header_file=None): ! if None is decl_type: ! decl_type = calldef.operator_t ! calldef_matcher_t.__init__( self ! , name=name ! , return_type=return_type ! , arg_types=arg_types ! , decl_type=decl_type ! , header_dir=header_dir ! , header_file=header_file) ! self.symbol = symbol def __call__( self, decl ): if not super( operator_matcher_t, self ).__call__( decl ): return False ! if not None is self.symbol: ! if self.symbol != decl.symbol: ! return False ! return True def __str__( self ): |