[pygccxml-commit] SF.net SVN: pygccxml:[1663] pyplusplus_dev/pyplusplus
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-02-08 19:52:55
|
Revision: 1663 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1663&view=rev Author: roman_yakovenko Date: 2009-02-08 19:52:49 +0000 (Sun, 08 Feb 2009) Log Message: ----------- sphinx Modified Paths: -------------- pydsc_dev/docs/pydsc.rest pydsc_dev/pydsc.py pygccxml_dev/pygccxml/binary_parsers/undname.py pygccxml_dev/pygccxml/parser/directory_cache.py pyplusplus_dev/pyplusplus/_logging_/multi_line_formatter.py pyplusplus_dev/pyplusplus/code_creators/code_creator.py pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py pyplusplus_dev/pyplusplus/creators_factory/sort_algorithms.py pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py pyplusplus_dev/pyplusplus/file_writers/balanced_files.py pyplusplus_dev/pyplusplus/file_writers/multiple_files.py pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py Modified: pydsc_dev/docs/pydsc.rest =================================================================== --- pydsc_dev/docs/pydsc.rest 2009-02-08 13:53:58 UTC (rev 1662) +++ pydsc_dev/docs/pydsc.rest 2009-02-08 19:52:49 UTC (rev 1663) @@ -35,20 +35,14 @@ import pydsc -and every module, that will be imported after it, will be checked. The errors -will be printed to stdout. +and every module, that will be imported after it, in the current working directory +will be checked. The errors will be printed to stdout. -For example: - -.. code-block:: python - - import pydsc - import readline - :mod:`pydsc` contains few functions, which helps you to configure the spell checker: * to define your own "ignore" dictionary * to define the error messages destination (file, stdout) - * to define set of files, which should be included or excluded + * to define set of files, which should be checked + * to ignore Sphinx specific words and code blocks For more information see :mod:`pydsc` module. Modified: pydsc_dev/pydsc.py =================================================================== --- pydsc_dev/pydsc.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pydsc_dev/pydsc.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -11,15 +11,16 @@ .. code-block:: python import pydsc - pydsc.include( r'D:\pygccxml_dev\pygccxml' ) #check only pygccxml package - pydsc.exclude( r'C:\Python' ) #don't check standard library - pydsc.ignore([ 'Yakovenko', 'www', 'org', 'py' ]) + pydsc.include_paths( r'D:\pygccxml_dev\pygccxml' ) #check only pygccxml package + pydsc.ignore_words([ 'Yakovenko', 'www', 'org', 'py' ]) + #if you use sphinx as a documentation tool: + pydsc.set_text_preprocessor( pydsc.sphinx_preprocessor ) """ -__version__ = '0.2' #current version -__author__ = 'Roman Yakovenko <rom...@gm...>' #Don't you want to know who is guilty? -__url__ = 'http://www.language-binding.net' #project home -__license__ = 'Boost Software License <http://boost.org/more/license_info.html>' #license +__version__ = '0.3' #current version +__author__ = 'Roman Yakovenko <rom...@gm...>' +__url__ = 'http://www.language-binding.net' +__license__ = 'Boost Software License <http://boost.org/more/license_info.html>' import os import re @@ -51,18 +52,6 @@ return bool( filter( lambda dir: path.startswith( dir ), dirs ) ) -#~ class DynamicIdentifiersFilter( enchant.tokenize.Filter): - #~ _pattern = re.compile(r"^.+@[^\.].*\.[a-z]{2,}$") - #~ def __init__( self, *args, **keywd ): - #~ super( DynamicIdentifiersFilter, self ).__init__( self, *args, **keywd ) - #~ self.global_identifiers = set() - #~ self.local_identifiers = set() - - #~ def _skip(self,word): - #~ if self._pattern.match(word): - #~ return True - #~ return False - def is_identifier( word ): """ returns `True` is the word represents an identifier, constructed from two or more words, `False` otherwise. @@ -242,7 +231,7 @@ for word, suggestions in errors.items(): write( ' misspelled word : %s%s' % ( word, os.linesep ) ) write( ' suggestions : %s%s' % ( `suggestions`, os.linesep ) ) - if 1: #debug code + if 0: #debug code clean = lambda t: t.replace( '\n', ' ' ).replace( '\r', '' ) write( ' source file text: %s\n' % clean( text_ ) ) write( ' checked text : %s\n' % clean( text ) ) @@ -370,4 +359,6 @@ def __call__( self, text ): return self.__replace_via_re( text ) +#sphinx_preprocessor, instance of :class:`sphinx_preprocessor_t` allows to remove +#some special words and code from the text. sphinx_preprocessor = sphinx_preprocessor_t() Modified: pygccxml_dev/pygccxml/binary_parsers/undname.py =================================================================== --- pygccxml_dev/pygccxml/binary_parsers/undname.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pygccxml_dev/pygccxml/binary_parsers/undname.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -67,7 +67,7 @@ .dll, .map and .so files. On Windows, the class works with unique name produced by MSVC compiler and - with undecorated names produced by dbghelp.dll + with undecorated names produced by `dbghelp.dll` On Linux, the class works with mangled names produced by GCC-XML ( GCC 4.2 ) compiler and demangled name produced by "nm" utility. Modified: pygccxml_dev/pygccxml/parser/directory_cache.py =================================================================== --- pygccxml_dev/pygccxml/parser/directory_cache.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pygccxml_dev/pygccxml/parser/directory_cache.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -156,7 +156,7 @@ :param source_file: Header file name :type source_file: str :param configuration: Configuration object - :type configuration: L{config_t} + :type configuration: :class:`parser.config_t` :rtype: Cached declarations or None """ @@ -199,10 +199,9 @@ def _load(self): """Load the cache. - Loads the file index.dat which contains the index table and - the file name repository. + Loads the `index.dat` file, which contains the index table and the file name repository. - This method is called by the constructor. + This method is called by the :meth:`__init__` """ indexfilename = os.path.join(self.__dir, "index.dat") Modified: pyplusplus_dev/pyplusplus/_logging_/multi_line_formatter.py =================================================================== --- pyplusplus_dev/pyplusplus/_logging_/multi_line_formatter.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/_logging_/multi_line_formatter.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -44,7 +44,7 @@ record.message = record.getMessage() Now this method temporarily replaces the getMessage() method of - the record by a version that returns a pre-generated message that + the record by a version that returns a generated message that spans several lines. Then the original format() method is called which will invoke the 'fake' method. """ Modified: pyplusplus_dev/pyplusplus/code_creators/code_creator.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/code_creator.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/code_creators/code_creator.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -147,7 +147,7 @@ def beautify( self, code ): """ - function that returns code without leading and trailing whitespaces. + function that returns code without leading and trailing white spaces. :param code: A code block with C++ source code. :type code: str Modified: pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -82,7 +82,7 @@ class smart_pointers_converter_t( registration_based.registration_based_t , declaration_based.declaration_based_t ): """ creator for boost::python::implicitly_convertible. - This creates a statemnt that allows the usage of C++ implicit + This creates a statement that allows the usage of C++ implicit conversion from source to target. See: http://www.boost.org/libs/python/doc/v2/implicit.html """ Modified: pyplusplus_dev/pyplusplus/creators_factory/sort_algorithms.py =================================================================== --- pyplusplus_dev/pyplusplus/creators_factory/sort_algorithms.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/creators_factory/sort_algorithms.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -116,20 +116,20 @@ for fname in self.__desired_order: answer.append( fname2inst[fname] ) return answer - -class calldef_organizer_t( object ): + +class calldef_organizer_t( object ): #Take a look on this post: # http://mail.python.org/pipermail/c++-sig/2006-October/011463.html - #calldef_organizer_t will take into account only requiered arguments. + #calldef_organizer_t will take into account only required arguments. #Next rules are implemented: #1. calldef( bool ) will be the last registered function #2. T* will come after T ( const T& ) def __init__( self ): object.__init__( self ) - #preserve order in which functions where defined + #preserve order in which functions where defined self.__cmp_unrelated = lambda d1, d2: cmp( d1.location.line, d2.location.line ) - + def __build_groups( self, decls ): groups = { None: [] } for d in decls: @@ -145,7 +145,7 @@ return decl_wrappers.algorithm.registration_order.is_related( t1, t2 ) def __cmp( self, f1, f2 ): - result = self.__cmp_types( f1.arguments[0].type, f2.arguments[0].type ) + result = self.__cmp_types( f1.arguments[0].type, f2.arguments[0].type ) if None is result: result = self.__cmp_unrelated( f1, f2 ) return result @@ -155,7 +155,7 @@ if None is group: continue groups[ group ].sort( self.__cmp ) - + def __join_groups( self, groups ): decls = [] sorted_keys = groups.keys() @@ -168,7 +168,7 @@ groups = self.__build_groups( decls ) self.__sort_groups(groups) result = self.__join_groups(groups) - return result + return result def sort_classes( classes ): organizer = class_organizer_t( classes ) @@ -177,8 +177,8 @@ def sort_calldefs( decls ): return calldef_organizer_t().sort( decls ) -USE_CALLDEF_ORGANIZER = False -#If you understand what problem calldef_organizer_t solves, than may be you should +USE_CALLDEF_ORGANIZER = False +#If you understand what problem calldef_organizer_t solves, than may be you should #use this. def sort( decls ): @@ -219,7 +219,7 @@ else: others.sort( cmp=cmp_by_name ) constructors.sort( cmp=cmp_by_line ) - + new_ordered = [] new_ordered.extend( enums ) new_ordered.extend( classes ) Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -92,7 +92,7 @@ def has_wrapper( self ): """returns True, if function - wrapper is needed - The functionality by this function is uncomplete. So please don't + The functionality by this function is incomplete. So please don't use it in your code. """ if not isinstance( self, declarations.member_calldef_t ): Modified: pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -170,7 +170,7 @@ """change "exportable" status This function should be use in case `Py++` made a mistake and signed the - declaration as unexportable.""" + declaration as non-exportable.""" self._exportable = exportable exportable = property( get_exportable, set_exportable Modified: pyplusplus_dev/pyplusplus/file_writers/balanced_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/balanced_files.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/file_writers/balanced_files.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -18,7 +18,7 @@ #TODO: to add namespace_alias_t classes class balanced_files_t(multiple_files.multiple_files_t): """ - This class implements classic strategy of deviding classes to files + This class implements classic strategy of dividing classes to files one class in one header + source files. """ HEADER_EXT = '.pypp.hpp' Modified: pyplusplus_dev/pyplusplus/file_writers/multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/file_writers/multiple_files.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -16,22 +16,19 @@ #TODO: to add namespace_alias_t classes class multiple_files_t(writer.writer_t): """ - This class implements classic strategy of deviding classes to files + This class implements classic strategy of dividing classes to files one class in one header + source files. """ HEADER_EXT = '.pypp.hpp' SOURCE_EXT = '.pypp.cpp' def __init__(self, extmodule, directory_path, write_main=True, files_sum_repository=None, encoding='ascii'): - """Constructor. - - :param extmodule: The root of a code creator tree - :type extmodule: bpmodule_t - :param directory_path: The output directory where the source files are written + """ + :param extmodule: code creators tree root + :type extmodule: :class:`code_creators.bpmodule_t` + :param directory_path: generated source files directory :type directory_path: str - - :param write_main: if it is True, the class will write out a main file - that calls all the registration methods. + :param write_main: if True, the class will write out a main file that calls all the registration methods. :type write_main: boolean """ writer.writer_t.__init__( self, extmodule, files_sum_repository, encoding=encoding ) Modified: pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py 2009-02-08 13:53:58 UTC (rev 1662) +++ pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py 2009-02-08 19:52:49 UTC (rev 1663) @@ -216,20 +216,17 @@ , enable_indexing_suite=True , doc_extractor=None): """ - Creates L{bpmodule_t} code creator. + Creates :class:`code_creators.bpmodule_t` code creator. :param module_name: module name - :type module_name: string + :type module_name: str - :param boost_python_ns_name: boost::python namespace alias, by default - it is 'bp' - :type boost_python_ns_name: string + :param boost_python_ns_name: boost::python namespace alias, by default it is `bp` + :type boost_python_ns_name: str - :param call_policies_resolver_: callable, that will be invoked on every - calldef object. It should return call policies. + :param call_policies_resolver_: callable, that will be invoked on every calldef object. It should return call policies. :type call_policies_resolver_: callable - :param doc_extractor: callable, that takes as argument reference to declaration - and returns documentation string + :param doc_extractor: callable, that takes as argument reference to declaration and returns documentation string :type doc_extractor: callable or None """ @@ -333,17 +330,17 @@ , on_unused_file_found=os.remove , use_files_sum_repository=False): """ - Writes module to multiple files + writes module to multiple files :param dir_name: directory name - :type dir_name: string + :type dir_name: str :param huge_classes: list that contains reference to classes, that should be split :param on_unused_file_found: callable object that represents the action that should be taken on file, which is no more in use - @use_files_sum_repository: `Py++` can generate file, which will contain md5 sum of every generated file. + @use_files_sum_repository: `Py++` can generate file, which will contain `md5` sum of every generated file. Next time you generate code, md5sum will be loaded from the file and compared. This could speed-up code generation process by 10-15%. """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |