[pygccxml-commit] SF.net SVN: pygccxml:[1667] pyplusplus_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-02-09 14:10:01
|
Revision: 1667 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1667&view=rev Author: roman_yakovenko Date: 2009-02-09 14:09:58 +0000 (Mon, 09 Feb 2009) Log Message: ----------- sphinx Modified Paths: -------------- pygccxml_dev/pygccxml/parser/directory_cache.py pyplusplus_dev/README.txt pyplusplus_dev/docs/documentation/apidocs/messages.rest pyplusplus_dev/docs/documentation/index.rest pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py pyplusplus_dev/pyplusplus/function_transformers/transformers.py pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py Modified: pygccxml_dev/pygccxml/parser/directory_cache.py =================================================================== --- pygccxml_dev/pygccxml/parser/directory_cache.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pygccxml_dev/pygccxml/parser/directory_cache.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -112,9 +112,9 @@ :param source_file: a C++ source file name. :type source_file: str :param configuration: configuration object. - :type configuration: :class:config_t + :type configuration: :class:`config_t` :param declarations: declarations contained in the `source_file` - :type declarations: picklable object + :type declarations: pickable object :param included_files: included files :type included_files: list of str """ @@ -260,7 +260,6 @@ :param filename: Output file name :type filename: str :param data: A Python object that will be pickled - :type data: pickable object """ if self.__compression: f = gzip.GzipFile(filename, "wb") Modified: pyplusplus_dev/README.txt =================================================================== --- pyplusplus_dev/README.txt 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/README.txt 2009-02-09 14:09:58 UTC (rev 1667) @@ -41,8 +41,7 @@ python setup.py doc -In order for this to work you need epydoc (http://epydoc.sourceforge.net) -and pygccxml. +In order for this to work you need Sphinx and pygccxml. -------------------------------------------------------------------------- Modified: pyplusplus_dev/docs/documentation/apidocs/messages.rest =================================================================== --- pyplusplus_dev/docs/documentation/apidocs/messages.rest 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/docs/documentation/apidocs/messages.rest 2009-02-09 14:09:58 UTC (rev 1667) @@ -1,19 +1,10 @@ -Pyplusplus\Messages Documentation -================================= +=========================== +pyplusplus.messages package +=========================== -This page contains the Pyplusplus\Messages Package documentation. +warnings_ +--------- -The :mod:`messages.warnings_` Modules -------------------------------------- - -.. automodule:: messages.warnings_ +.. automodule:: pyplusplus.messages.warnings_ :members: :show-inheritance: - -The :mod:`pyplusplus\messages` Package --------------------------------------- - -.. automodule:: pyplusplus\messages - :members: - :show-inheritance: - Modified: pyplusplus_dev/docs/documentation/index.rest =================================================================== --- pyplusplus_dev/docs/documentation/index.rest 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/docs/documentation/index.rest 2009-02-09 14:09:58 UTC (rev 1667) @@ -12,7 +12,7 @@ How can you help? * Lets face it: today it is not possible to use :doc:`Py++ <../pyplusplus>` without eventually - looking into source code. :doc:`Py++ <../pyplusplus>` uses `epydoc`_ to generate documentation + looking into source code. :doc:`Py++ <../pyplusplus>` uses Sphinx to generate documentation from source files. So, if you found some undocumented piece of code and you understand what it does, please write documentation string. @@ -44,7 +44,6 @@ functions/functions.rest how_to/how_to.rest -.. _`epydoc` : http://epydoc.sourceforge.net/ .. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html .. _`Python`: http://www.python.org .. _`GCC-XML`: http://www.gccxml.org Modified: pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/pyplusplus/code_creators/smart_pointers.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -12,11 +12,14 @@ templates = declarations.templates class held_type_t(object): - """ Helper class that can hold name of `smart_ptr` type and create - identifier for held type from that given a creator. """ + Helper class that can hold smart pointer name and create identifier for the + held type from that given a creator. + """ def __init__( self, smart_ptr ): - """ smart_ptr: string of ptr type. Ex: `boost::shared_ptr`""" + """ + :param smart_ptr: smart pointer type as string + """ object.__init__( self ) self._smart_ptr = smart_ptr Modified: pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/pyplusplus/decl_wrappers/algorithm.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -9,13 +9,14 @@ from pygccxml import declarations def creators_affect_on_me( me ): - """Find all relevant code creators, which influence on code generated by "me". + """ + find all relevant code creators, which influence on code generated by "me". - C++ allows to define aliases to namespaces. `Py++` allows user to define aliases - to the namespace and will take this aliases into account when it generates - the code. + C++ allows to define aliases to namespaces. `Py++` allows user to define + aliases to the namespace and will take this aliases into account when it + generates the code. - Example: + Example: :: [a b c d e f g] | @@ -49,12 +50,13 @@ __RE_VALID_IDENTIFIER = re.compile( r"[_a-z]\w*", re.I | re.L | re.U ) def create_valid_name(name): - """Create valid name\\Python identifier from a string + """ + creates Python identifier from a string - As input this functions takes valid C++ name\identifier and replaces all invalid - characters. + As input this functions takes valid C++ name\\identifier and replaces all + illegal characters. - Invalid characters are introduced by a template instantiation. + Illegal characters are introduced by a template instantiation. """ global __RE_VALID_IDENTIFIER match_found = __RE_VALID_IDENTIFIER.match(name) Modified: pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/pyplusplus/decl_wrappers/variable_wrapper.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -65,18 +65,21 @@ , doc=__call_policies_doc__ ) __use_make_functions_doc__ = \ - """Generate code using make_getter and make_setter functions + """ + Generate code using `make_getter` and `make_setter` functions - Basically you don't need to use this, untill you have one of the next use-cases: - * member variable is smart pointer - in this case Boost.Python has small problem - to expose it right. Using the functions is a work around to the problem. - * member variable defined custom r-value converter - may be you don't know - but the conversion is applied only on functions arguments. So you need to - use make_getter/make_setter in order to allow user to enjoy from the - conversion. + Basically you don't need to use this, untill you have one of the following + use-cases: - Setting "apply_smart_ptr_wa" and/or "use_make_functions" to "True" will tell - `Py++` to generate such code. + * member variable is smart pointer - in this case Boost.Python has small + problem to expose it right. Using get/set functions is a work-around. + + * member variable defined custom r-value converter - may be you don't know + but the conversion is applied only on functions arguments. So you need to + use make_getter/make_setter functions, allow users to enjoy from the conversion. + + Setting :attr:`apply_smart_ptr_wa` and/or :attr:`use_make_functions` to "True" + will tell `Py++` to generate such code. """ def get_apply_smart_ptr_wa( self ): Modified: pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/pyplusplus/file_writers/class_multiple_files.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -3,9 +3,10 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -"""defines a class that writes :class:`code_creators.bpmodule_t` to multiple files, the class -also splits huge C++ classes to few source files """ +defines a class that writes :class:`code_creators.bpmodule_t` to multiple files, +the class also splits huge C++ classes to few source files. +""" import os import writer @@ -15,18 +16,21 @@ from pyplusplus import code_creators from pyplusplus import utils as pypp_utils -#TODO: to add namespace_alias_t classes class class_multiple_files_t(multiple_files.multiple_files_t): """ This class will split code, generated for huge classes, to few files. - Next strategy will be used: - 1. New directory with class alias name will be created. - 2. pyplusplus will generate - wrapper header - header that will contain code generated for class wrappers - classes h/cpp - will contain registration code for internal classes - `memfun` h/cpp - will contain registration code for member functions + The following strategy will be used: - alias + _main h/cpp this class will contain main registration function. + * New directory, named after a class alias, will be created. + + * `Py++` will generate + + * wrapper header - header that will contain code generated for class wrappers + * classes h/cpp - will contain registration code for internal classes + * `memfun` h/cpp - will contain registration code for member functions + + The main class registration function will be placed in "%(class alias)s_main" + header and source files. """ def __init__( self Modified: pyplusplus_dev/pyplusplus/function_transformers/transformers.py =================================================================== --- pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/pyplusplus/function_transformers/transformers.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -428,9 +428,10 @@ class input_c_buffer_t(transformer.transformer_t): - """handles an input of C buffer: + """ + handles an input of C buffer: - void write( byte *buffer, int size ) -> void write( python sequence ) + void write( byte \\*buffer, int size ) -> void write( python sequence ) """ def __init__(self, function, buffer_arg_ref, size_arg_ref): Modified: pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py 2009-02-09 11:29:59 UTC (rev 1666) +++ pyplusplus_dev/pyplusplus/module_builder/boost_python_builder.py 2009-02-09 14:09:58 UTC (rev 1667) @@ -108,17 +108,18 @@ def register_module_dependency( self, other_module_generated_code_dir ): - """``already_exposed`` solution is pretty good when you mix hand-written + """ + `already_exposed` solution is pretty good when you mix hand-written modules with `Py++` generated. It doesn't work/scale for "true" multi-module development. This is exactly the reason why `Py++` offers "semi automatic" solution. - For every exposed module, `Py++` generates "exposed_decl.pypp.txt" file. + For every exposed module, `Py++` generates `exposed_decl.pypp.txt` file. This file contains the list of all parsed declarations and whether they were included or excluded. Later, when you work on another module, you can tell `Py++` that the current module depends on the previously - generated one. `Py++` will load "exposed_decl.pypp.txt" file and - update the declarations. + generated one. `Py++` will load `exposed_decl.pypp.txt` file and update + the declarations. """ db = utils.exposed_decls_db_t() @@ -269,14 +270,23 @@ self.__registrations_code_head.append( code ) def add_constants( self, **keywds ): - """adds code that exposes some constants to Python. + """ + adds code that exposes some constants to Python. For example: - mb.add_constants( version='"1.2.3"' ) - or - mb.add_constants( **{ version:'"1.2.3"' } ) - will generate next code: - boost::python::scope().attr("version") = "1.2.3"; + .. code-block:: python + + mb.add_constants( version='"1.2.3"' ) + # or + constants = dict( version:'"1.2.3"' ) + mb.add_constants( \\*\\*constants ) + + will generate the following code: + + .. code-block:: c++ + + boost::python::scope().attr("version") = "1.2.3"; + """ tmpl = 'boost::python::scope().attr("%(name)s") = %(value)s;' for name, value in keywds.items(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |