Revision: 774
http://svn.sourceforge.net/pygccxml/?rev=774&view=rev
Author: roman_yakovenko
Date: 2006-12-03 13:55:33 -0800 (Sun, 03 Dec 2006)
Log Message:
-----------
updating docs and small change to dependencies manager
Modified Paths:
--------------
pygccxml_dev/docs/pygccxml.rest
pygccxml_dev/docs/www_configuration.py
pyplusplus_dev/docs/pyplusplus.rest
pyplusplus_dev/pyplusplus/module_creator/dependencies_manager.py
Modified: pygccxml_dev/docs/pygccxml.rest
===================================================================
--- pygccxml_dev/docs/pygccxml.rest 2006-12-01 21:19:09 UTC (rev 773)
+++ pygccxml_dev/docs/pygccxml.rest 2006-12-03 21:55:33 UTC (rev 774)
@@ -16,19 +16,19 @@
------------
.. include:: ./definition.rest
-----------------------
-What can I do with it?
-----------------------
+------------------------
+What can you do with it?
+------------------------
Using `pygccxml`_ you can:
* parse C++ source code
-* build a code generator
+* create a powerful code generator
- + `Py++`_ is heavily based on `pygccxml`_
- + generate `WSDL`_ file from sources
- + ...
+ + `Py++`_ is heavily based on `pygccxml`_
+ + generate `WSDL`_ file from sources
+ + ...
-* create UML diagrams
+* generate UML diagrams
* build code analyzer
* ...
@@ -50,22 +50,35 @@
Features
--------
-Caching
--------
+Query interface
+---------------
+`pygccxml`_ provides simple and powerful API to query declarations tree. How many
+lines is needed to write next query?
+::
-Consider the following situation: you have to parse the same set of files every
-day. There are 2 possible ways to complete the task:
+ select all free functions from the project
+ where
+ name equal to "do_smth"
+ return type is void
+ function has two arguments
+ second argument type is int
-* create a header file that includes all files you need to parse
+Only 1 ( one ) line of code is needed:
-* parse each file separately and then join the results
+.. code-block:: Python
-The difference between these approaches is the caching algorithm used in the
-second case. `pygccxml`_ supports both of them.
+ #global_ns is the reference to declarations, which describes global( :: ) namespace
+ global_ns.free_functions( "do_smth", return_type='void', arg_types=[None,'int'] )
+``None`` means "any type". In my opinion the code is prety clear and readable.
+
+If you want to know more about provided API read `query interface`__ document or
+API documentation.
+
+.. __: ./query_interface.html
+
Type traits
-----------
-
`pygccxml`_ provides a lot of functionality to analyze C++ types and relationship
between them. For more information please refer to `design`__ document or API
documentation. Just a few names of algorithms:
@@ -82,35 +95,27 @@
.. __: ./design.html
-Query interface
----------------
+Declaration dependencies
+------------------------
+You can query a declaration, about it dependencies - declarations it depends on.
+This is very powerful and useful feature. `Py++`_, for example, uses this
+functionality to check that user creates Python bindings for all relevant
+declarations.
-`pygccxml`_ provides simple and powerful API to query declarations tree. I will
-try to give small example, that will prove my point. If you want to know more
-about provided API please read `query interface`__ document or API documentation.
-Examples:
+Caching
+-------
+Consider the following situation: you have to parse the same set of files every
+day. There are 2 possible ways to complete the task:
-.. code-block:: Python
+* create a header file that includes all files you need to parse
- #global_ns is the reference to declarations that describes C++ namespace.
- #In our case, instance of that declarations describes global ( :: ) namespace.
- global_ns.free_functions( "do_smth", return_type='void', arg_types=[None,'int'] )
-
+* parse each file separately and then join the results
-Small explanation. Assume that ``None`` means "any type". Now the code is pretty
-readable:
+The difference between these approaches is the caching algorithm used in the
+second case. `pygccxml`_ supports both of them. Actually `pygccxml`_ supports
+more caching strategies, read the API documentation for more information.
-::
- select all free functions from the project
- where
- name equal to "do_smth"
- return type is void
- function has two arguments
- second argument type is int
-
-.. __: ./query_interface.html
-
-------
License
-------
@@ -122,10 +127,9 @@
-----------------
`pygccxml`_ comes with comprehensive unit tests. It is running on Windows XP and
-`Ubuntu`_. I am using `Python`_ 2.4 and `GCC-XML`_ CVS.
-Right now I am running more then 150 tests. They test almost every piece of code.
-Also I have performance tests. Most of the time I am using "white box" testing
-strategy.
+`Ubuntu`_. I am using `Python`_ 2.4\\2.5 and `GCC-XML`_ CVS. `pygccxml`_ has
+more then 170 tests. They test almost every piece of code. It also has performance
+tests. Most of the time I am using "white box" testing strategy.
.. _`WSDL`: http://www.w3.org/TR/wsdl
.. _`Py++`: ./../pyplusplus/pyplusplus.html
Modified: pygccxml_dev/docs/www_configuration.py
===================================================================
--- pygccxml_dev/docs/www_configuration.py 2006-12-01 21:19:09 UTC (rev 773)
+++ pygccxml_dev/docs/www_configuration.py 2006-12-03 21:55:33 UTC (rev 774)
@@ -1,3 +1,3 @@
name = 'pygccxml'
files_to_skip = ['definition.rest']
-names = { 'query_interface' : 'query interface' }
\ No newline at end of file
+names = { 'query_interface' : 'query interface' }
Modified: pyplusplus_dev/docs/pyplusplus.rest
===================================================================
--- pyplusplus_dev/docs/pyplusplus.rest 2006-12-01 21:19:09 UTC (rev 773)
+++ pyplusplus_dev/docs/pyplusplus.rest 2006-12-03 21:55:33 UTC (rev 774)
@@ -9,23 +9,20 @@
-------------
.. include:: ./definition.rest
+`Py++`_ is a powerful code generator that uses few different programming paradigms
+to help you to expose C++ declarations to Python. This code generator will not
+stand on your way. It will guide you through the whole process. It will raise
+warnings in the case you are doing something wrong with a link to the explanation.
+And the most important it will save your time - you will not have to update
+code generator script every time you change source code.
---------
-Preamble
---------
-
-This introduction will describe code generation process using Py++.
-I hope, that after you finished to read it, you will understand how powerful
-Py++ is.
-
-----------------------
Code generation process
-----------------------
`Boost.Python`_ library allows you to expose C++ code to `Python`_ in quick and
-elegant way. Almost the whole process of exposing declarations can be automated
-by use of Py++. Code generation process, using Py++ consists
-from few steps. Next paragraphs will tell you more about every step.
+elegant way. Code generation process, using Py++ consists from few steps.
+Next paragraphs will tell you more about every step.
*"read declarations"*
@@ -74,7 +71,7 @@
#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
+Another example - the developer wants to exclude all protected functions from
being exported:
.. code-block:: Python
@@ -128,64 +125,38 @@
Features list
-------------
- * classes
+* `Py++`_ support almost all features found in `Boost.Python`_ library
- * class wrappers
+* `Py++`_ generates code, which will help you to understand compiler generated
+ error messages
- * two modes of code generation:
+* `Py++`_ has few modes of writing code into files:
+
+ * single file
- * using scope - better error messages location from compiler
+ * multiple files
- * no scope
+ * multiple files, where single class code is splitted to few files
- * automatic detection of held type
+* `Py++`_ will save your compilation time - it will rewrite a file, only in case
+ of change
- * nested classes
+* You have full control over generated code. Your code could be inserted almost
+ anywhere.
- * implicit conversion
+* Your license is written at the top of every file
- * functions
+* `Py++`_ will check the "completeness" of the bindings. It will check for you
+ that exposed declarations don't have references to unexposed ones.
- * virtual methods
+* `Py++`_ provides enough functionality to extract source code documentation
+ and write it as Python documentation string
- * protected method, even non-virtual ones can be accessed from `Python`_.
+* `Py++`_ provides simple and powerful framework to create wraper for functions,
+ which could not be exposed as is to `Python`_.
- * overloading
+* ...
- * two modes of code generation:
-
- * with function type - good for exporting template instantiated
- functions and overloaded ones.
-
- * without function type
-
- * static methods
-
- * code generated for wrapped methods takes into account types of arguments
-
- * operators, both free and member ones
-
- * call policies resolver
-
- * enumerations
-
- * variables, bit fields
-
- * namespace aliasing and using
-
- * writing multiple files
-
- * user code could be inserted almost any where
-
- * write code into file if there were changes
-
- * user license is written at the top of every file
-
- * extracting documentation from source files and integrating it with generated
- source code
-
- * ...
-
-------
License
-------
Modified: pyplusplus_dev/pyplusplus/module_creator/dependencies_manager.py
===================================================================
--- pyplusplus_dev/pyplusplus/module_creator/dependencies_manager.py 2006-12-01 21:19:09 UTC (rev 773)
+++ pyplusplus_dev/pyplusplus/module_creator/dependencies_manager.py 2006-12-03 21:55:33 UTC (rev 774)
@@ -3,6 +3,9 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
+"""defines class, which informs user about used, but unexposed declarations"""
+
+import os
from pygccxml import declarations
from pyplusplus import decl_wrappers
@@ -70,12 +73,24 @@
used_not_exported.append( dependency )
return used_not_exported
- def __create_msg( self, dependency ):
- reason = 'The declaration depends on unexposed declaration "%s".' \
- % dependency.find_out_depend_on_declaration()
- return "%s;%s" % ( dependency.declaration, reason )
+ def __group_by_unexposed( self, dependencies ):
+ groups = {}
+ for dependency in dependencies:
+ depend_on_decl = dependency.find_out_depend_on_declaration()
+ if not groups.has_key( id( depend_on_decl ) ):
+ groups[ id( depend_on_decl ) ] = []
+ groups[ id( depend_on_decl ) ].append( dependency )
+ return groups
+
+ def __create_msg( self, dependencies ):
+ depend_on_decl = dependencies[0].find_out_depend_on_declaration()
+ reason = [ 'There are declarations, which depend on the unexposed one:' ]
+ for dependency in dependencies:
+ reason.append( ' ' + str( dependency.declaration ) )
+ return "%s;%s" % ( depend_on_decl, os.linesep.join( reason ) )
def inform_user( self ):
used_not_exported_decls = self.__find_out_used_but_not_exported()
- for used_not_exported in used_not_exported_decls:
- self.__logger.warn( self.__create_msg( used_not_exported ) )
+ groups = self.__group_by_unexposed( used_not_exported_decls )
+ for group in groups.itervalues():
+ self.__logger.warn( self.__create_msg( group ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|