pygccxml-commit Mailing List for C++ Python language bindings (Page 17)
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
|
|
From: <rom...@us...> - 2008-11-27 20:28:51
|
Revision: 1457
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1457&view=rev
Author: roman_yakovenko
Date: 2008-11-27 20:28:46 +0000 (Thu, 27 Nov 2008)
Log Message:
-----------
making indexing suite v2 functionality to be header only
Modified Paths:
--------------
pyplusplus_dev/indexing_suite_v2/indexing/python_iterator.hpp
pyplusplus_dev/indexing_suite_v2/indexing/slice.hpp
pyplusplus_dev/indexing_suite_v2/readme.txt
Modified: pyplusplus_dev/indexing_suite_v2/indexing/python_iterator.hpp
===================================================================
--- pyplusplus_dev/indexing_suite_v2/indexing/python_iterator.hpp 2008-11-26 22:03:00 UTC (rev 1456)
+++ pyplusplus_dev/indexing_suite_v2/indexing/python_iterator.hpp 2008-11-27 20:28:46 UTC (rev 1457)
@@ -16,23 +16,58 @@
//
// $Id: python_iterator.hpp,v 1.1.2.5 2003/11/24 16:35:09 raoulgough Exp $
//
+// 2008 November 27 Roman Yakovenko
+// implementation of the member functions was moved from cpp to header.
+// this was done to simplify "installation" procedure.
#ifndef BOOST_PYTHON_INDEXING_PYTHON_ITERATOR_HPP
#define BOOST_PYTHON_INDEXING_PYTHON_ITERATOR_HPP
#include <boost/python/object.hpp>
+#include <boost/python/handle.hpp>
namespace boost { namespace python { namespace indexing {
struct BOOST_PYTHON_DECL python_iterator
{
- python_iterator (boost::python::object);
+ python_iterator (boost::python::object obj)
+ : m_iter_obj (handle<> (PyObject_GetIter (obj.ptr()))),
+ m_next_method (m_iter_obj.attr ("next")),
+ m_current()
+ {
+ }
+
// Sets a python type exception and calls throw_error_already_set if
// the passed object is not iterable via PyObject_GetIter
- bool next ();
+ bool next ()
+ {
+ bool result = true; // Assume success
+
+ try
+ {
+ m_current = m_next_method ();
+ }
+ catch (boost::python::error_already_set const &)
+ {
+ if (PyErr_ExceptionMatches (PyExc_StopIteration))
+ {
+ // Eat this exception
+ PyErr_Clear ();
+ m_current = boost::python::object (); // No current object
+ result = false; // Report failure via return value only
+ }
+ else
+ {
+ // Pass it up the line
+ throw;
+ }
+ }
+ return result;
+ }
// Get the next item from the iterator, returning true for success
- boost::python::object current() const;
+ boost::python::object current() const
+ { return m_current; }
// Callable only after a successful next()
private:
Modified: pyplusplus_dev/indexing_suite_v2/indexing/slice.hpp
===================================================================
--- pyplusplus_dev/indexing_suite_v2/indexing/slice.hpp 2008-11-26 22:03:00 UTC (rev 1456)
+++ pyplusplus_dev/indexing_suite_v2/indexing/slice.hpp 2008-11-27 20:28:46 UTC (rev 1457)
@@ -12,6 +12,9 @@
//
// $Id: slice.hpp,v 1.1.2.10 2003/11/24 14:28:31 raoulgough Exp $
//
+// 2008 November 27 Roman Yakovenko
+// implementation of the member functions was moved from cpp to header.
+// this was done to simplify "installation" procedure.
#ifndef BOOST_PYTHON_INDEXING_SLICE_HPP
#define BOOST_PYTHON_INDEXING_SLICE_HPP
@@ -19,6 +22,7 @@
#include <boost/python/object.hpp>
#include <boost/python/errors.hpp>
#include <boost/python/converter/pytype_object_mgr_traits.hpp>
+#include <algorithm>
namespace boost { namespace python { namespace indexing {
struct BOOST_PYTHON_DECL slice : public boost::python::object
@@ -31,16 +35,29 @@
// MSVC6 doesn't seem to be able to invoke the templated
// constructor, so provide explicit overloads to match the
// (currently) known boost::python::object constructors
- explicit slice (::boost::python::handle<> const&);
- explicit slice (::boost::python::detail::borrowed_reference);
- explicit slice (::boost::python::detail::new_reference);
- explicit slice (::boost::python::detail::new_non_null_reference);
+ explicit slice (::boost::python::handle<> const& p)
+ : object (p)
+ {}
+
+ explicit slice (::boost::python::detail::borrowed_reference p)
+ : object (p)
+ {}
+
+ explicit slice (::boost::python::detail::new_reference p)
+ : object (p)
+ {}
+
+ explicit slice (::boost::python::detail::new_non_null_reference p)
+ : object (p)
+ {}
#else
// Better compilers make life easier
template<typename T> inline slice (T const &ref);
#endif
- slice (slice const &); // Copy constructor
+ slice (slice const & copy) // Copy constructor
+ : object (copy)
+ {}
};
struct BOOST_PYTHON_DECL integer_slice
@@ -54,7 +71,28 @@
typedef Py_ssize_t index_type;
#endif
- integer_slice (slice const &, index_type length);
+ integer_slice (slice const & sl, index_type length)
+ : m_slice (sl) // Leave index members uninitialized
+ {
+ PySlice_GetIndices(
+ reinterpret_cast<PySliceObject *> (m_slice.ptr()),
+ length,
+ &m_start,
+ &m_stop,
+ &m_step);
+
+ if (m_step == 0)
+ {
+ // Can happen with Python prior to 2.3
+ PyErr_SetString (PyExc_ValueError, "slice step cannot be zero");
+ boost::python::throw_error_already_set ();
+ }
+
+ m_start = std::max (static_cast<index_type> (0), std::min (length, m_start));
+ m_stop = std::max (static_cast<index_type> (0), std::min (length, m_stop));
+ m_direction = (m_step > 0) ? 1 : -1;
+ }
+
// integer_slice must know how big the container is so it can
// adjust for negative indexes, etc...
@@ -64,7 +102,8 @@
index_type size() const { return (m_stop - m_start) / m_step; }
- bool in_range (index_type index);
+ bool in_range (index_type index)
+ { return ((m_stop - index) * m_direction) > 0; }
private:
slice m_slice;
Modified: pyplusplus_dev/indexing_suite_v2/readme.txt
===================================================================
--- pyplusplus_dev/indexing_suite_v2/readme.txt 2008-11-26 22:03:00 UTC (rev 1456)
+++ pyplusplus_dev/indexing_suite_v2/readme.txt 2008-11-27 20:28:46 UTC (rev 1457)
@@ -1,3 +1,10 @@
This directory contains indexing suite version developed by Raoul Gough.
-Almost every directory contains "readme.txt" file. Those files contain
-installation instructions.
\ No newline at end of file
+
+Installation instructions: copy "indexing" directory to "boost/python/suite" one.
+
+Changes from original version
+* bug fixes
+* support for 64Bit platforms was added
+* std::map and std::multimap containers got iteration functionality
+* the suite was made to be "header only"
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-26 22:03:02
|
Revision: 1456
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1456&view=rev
Author: roman_yakovenko
Date: 2008-11-26 22:03:00 +0000 (Wed, 26 Nov 2008)
Log Message:
-----------
fix 64Bit issue
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_repository/call_policies.py
Modified: pyplusplus_dev/pyplusplus/code_repository/call_policies.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_repository/call_policies.py 2008-11-25 18:53:36 UTC (rev 1455)
+++ pyplusplus_dev/pyplusplus/code_repository/call_policies.py 2008-11-26 22:03:00 UTC (rev 1456)
@@ -82,7 +82,7 @@
return bpl::detail::none();
}
else{
- boost::uint32_t addressof_p = reinterpret_cast< boost::uint32_t >( p );
+ size_t addressof_p = size_t( p );
bpl::object p_address( addressof_p );
return bpl::incref( p_address.ptr() );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-25 18:53:46
|
Revision: 1455
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1455&view=rev
Author: roman_yakovenko
Date: 2008-11-25 18:53:36 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
fixing 64Bit issues in tester
Modified Paths:
--------------
pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp
pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp
Modified: pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp
===================================================================
--- pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp 2008-11-25 18:52:38 UTC (rev 1454)
+++ pyplusplus_dev/unittests/data/global_variables_to_be_exported.cpp 2008-11-25 18:53:36 UTC (rev 1455)
@@ -21,7 +21,7 @@
int some_value = -7;
int get_some_value(){ return some_value; }
-unsigned int get_some_value_address(){ return (unsigned int)( &some_value ); }
+size_t get_some_value_address(){ return size_t( &some_value ); }
}
Modified: pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp 2008-11-25 18:52:38 UTC (rev 1454)
+++ pyplusplus_dev/unittests/data/global_variables_to_be_exported.hpp 2008-11-25 18:53:36 UTC (rev 1455)
@@ -6,6 +6,8 @@
#ifndef __global_variables_to_be_exported_hpp__
#define __global_variables_to_be_exported_hpp__
+#include <cstdlib>
+
namespace global_variables{
enum color{ red, green, blue };
@@ -23,7 +25,7 @@
int get_some_value();
-unsigned int get_some_value_address();
+size_t get_some_value_address();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-25 18:52:49
|
Revision: 1454
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1454&view=rev
Author: roman_yakovenko
Date: 2008-11-25 18:52:38 +0000 (Tue, 25 Nov 2008)
Log Message:
-----------
small changes to unit test process configuration
Modified Paths:
--------------
gccxml_bin/v09/linux2/share/gccxml-0.9/gccxml_config
pyplusplus_dev/environment.py
pyplusplus_dev/unittests/test_all.py
Modified: gccxml_bin/v09/linux2/share/gccxml-0.9/gccxml_config
===================================================================
--- gccxml_bin/v09/linux2/share/gccxml-0.9/gccxml_config 2008-11-24 20:22:35 UTC (rev 1453)
+++ gccxml_bin/v09/linux2/share/gccxml-0.9/gccxml_config 2008-11-25 18:52:38 UTC (rev 1454)
@@ -1,2 +1,2 @@
-GCCXML_COMPILER="/usr/bin/c++"
+GCCXML_COMPILER="/usr/bin/g++-4.2"
GCCXML_CXXFLAGS=" "
Modified: pyplusplus_dev/environment.py
===================================================================
--- pyplusplus_dev/environment.py 2008-11-24 20:22:35 UTC (rev 1453)
+++ pyplusplus_dev/environment.py 2008-11-25 18:52:38 UTC (rev 1454)
@@ -39,6 +39,8 @@
python.libs = 'e:/python25/libs'
python.include = 'e:/python25/include'
else:
+ os.nice( 20 )
+ print 'test process niceness: 20'
scons.suffix = '.so'
scons.ccflags = ['-DBOOST_PYTHON_NO_PY_SIGNATURES' ]
boost.libs = ['/home/roman/include/libs' ]
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2008-11-24 20:22:35 UTC (rev 1453)
+++ pyplusplus_dev/unittests/test_all.py 2008-11-25 18:52:38 UTC (rev 1454)
@@ -312,7 +312,6 @@
if __name__ == "__main__":
- os.nice( 20 )
runner = process_tester_runner_t( testers )
runner()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-24 20:22:37
|
Revision: 1453
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1453&view=rev
Author: roman_yakovenko
Date: 2008-11-24 20:22:35 +0000 (Mon, 24 Nov 2008)
Log Message:
-----------
fixing 64 bit issues in ctypes integration functionality
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/code_creators/global_variable.py
pyplusplus_dev/pyplusplus/code_repository/ctypes_integration.py
Modified: pyplusplus_dev/pyplusplus/code_creators/global_variable.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_creators/global_variable.py 2008-11-24 07:52:15 UTC (rev 1452)
+++ pyplusplus_dev/pyplusplus/code_creators/global_variable.py 2008-11-24 20:22:35 UTC (rev 1453)
@@ -177,7 +177,7 @@
#TODO: porting to 64Bit is welcome
result.append( algorithm.create_identifier( self, '::boost::python::scope' ) )
result.append( '().attr("%s")' % self.alias )
- result.append( ' = boost::uint32_t( boost::addressof( %s ) );' % self.decl_identifier )
+ result.append( ' = size_t( boost::addressof( %s ) );' % self.decl_identifier )
return ''.join( result )
def _get_system_headers_impl( self ):
Modified: pyplusplus_dev/pyplusplus/code_repository/ctypes_integration.py
===================================================================
--- pyplusplus_dev/pyplusplus/code_repository/ctypes_integration.py 2008-11-24 07:52:15 UTC (rev 1452)
+++ pyplusplus_dev/pyplusplus/code_repository/ctypes_integration.py 2008-11-24 20:22:35 UTC (rev 1453)
@@ -25,7 +25,6 @@
#include "boost/utility/addressof.hpp"
#include "boost/mpl/vector.hpp"
#include "boost/function.hpp"
-#include "boost/cstdint.hpp"
#include "boost/type.hpp"
#include "boost/bind.hpp"
@@ -33,23 +32,23 @@
namespace pyplusplus{ namespace convenience{
template< typename TType, typename TMemVarType >
-boost::uint32_t
+size_t
addressof( const TType* inst_ptr, const TMemVarType TType::* offset){
if( !inst_ptr ){
throw std::runtime_error( "unable to dereference null pointer" );
}
const TType& inst = *inst_ptr;
- return boost::uint32_t( boost::addressof( inst.*offset ) );
+ return size_t( boost::addressof( inst.*offset ) );
}
template< typename TType >
-boost::uint32_t
+size_t
addressof_inst( const TType* inst_ptr){
if( !inst_ptr ){
throw std::runtime_error( "unable to dereference null pointer" );
}
- return boost::uint32_t( inst_ptr );
+ return size_t( inst_ptr );
}
template< typename TType, typename TMemVarType >
@@ -59,7 +58,7 @@
namespace pyppc = pyplusplus::convenience;
return bpl::make_function( boost::bind( &pyppc::addressof< TType, TMemVarType >, _1, offset )
, bpl::default_call_policies()
- , boost::mpl::vector< boost::uint32_t, const TType* >() );
+ , boost::mpl::vector< size_t, const TType* >() );
}
template< typename TType >
@@ -69,7 +68,7 @@
namespace pyppc = pyplusplus::convenience;
return bpl::make_function( boost::bind( &pyppc::addressof_inst< TType >, _1 )
, bpl::default_call_policies()
- , boost::mpl::vector< boost::uint32_t, const TType* >() );
+ , boost::mpl::vector< size_t, const TType* >() );
}
class register_addressof_static_var : public boost::python::def_visitor<register_addressof_static_var>
@@ -91,7 +90,7 @@
}
private:
- boost::uint32_t m_address;
+ size_t m_address;
const char* m_name;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-24 07:52:17
|
Revision: 1452
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1452&view=rev
Author: roman_yakovenko
Date: 2008-11-24 07:52:15 +0000 (Mon, 24 Nov 2008)
Log Message:
-----------
update history
Modified Paths:
--------------
pyplusplus_dev/docs/history/history.rest
Modified: pyplusplus_dev/docs/history/history.rest
===================================================================
--- pyplusplus_dev/docs/history/history.rest 2008-11-23 20:53:20 UTC (rev 1451)
+++ pyplusplus_dev/docs/history/history.rest 2008-11-24 07:52:15 UTC (rev 1452)
@@ -24,8 +24,15 @@
* Oliver Schweitzer
* Hernán Ordiales
* Bernd Fritzke
+* Andrei Vermel
-----------
+SVN Version
+-----------
+
+1. The bug related to exposing free operators was fixed. Many thanks to Andrei Vermel.
+
+-----------
Version 1.0
-----------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-23 20:53:25
|
Revision: 1451
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1451&view=rev
Author: roman_yakovenko
Date: 2008-11-23 20:53:20 +0000 (Sun, 23 Nov 2008)
Log Message:
-----------
fix for few bugs related to free operators
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/module_creator/creator.py
pyplusplus_dev/unittests/data/operators_to_be_exported.hpp
pyplusplus_dev/unittests/operators_tester.py
pyplusplus_dev/unittests/test_all.py
Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py
===================================================================
--- pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-11-22 21:36:02 UTC (rev 1450)
+++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-11-23 20:53:20 UTC (rev 1451)
@@ -101,6 +101,7 @@
self.curr_decl = None
self.__array_1_registered = set() #(type.decl_string,size)
self.__free_operators = []
+ self.__std_containers_free_operators = {}
self.__exposed_free_fun_overloads = set()
self.__fc_manager = fake_constructors_manager.manager_t( global_ns )
@@ -174,30 +175,13 @@
pass
else:
assert not "Found %d class code creators" % len(creator)
-
+
find = code_creators.creator_finder.find_by_declaration
if operator.target_class and operator.target_class.ignore == False:
found = find( lambda decl: operator.target_class is decl
, self.__extmodule.body.creators )
adopt_operator_impl( operator, found )
- """
- find = code_creators.creator_finder.find_by_declaration
- if isinstance( operator.parent, declarations.class_t ):
- found = find( lambda decl: operator.parent is decl
- , self.__extmodule.body.creators )
- adopt_operator_impl( operator, found )
- else:
- #select all to be exposed declarations
- included = filter( lambda decl: decl.ignore == False, operator.class_types )
- if not included:
- msg = 'Py++ bug found!' \
- ' For some reason Py++ decided to expose free operator "%s", when all class types related to the operator definition are excluded.' \
- ' Please report this bug. Thanks! '
- raise RuntimeError( msg % str( operator ) )
- found = find( lambda decl: included[0] is decl, self.__extmodule.body.creators )
- adopt_operator_impl( operator, found )
- """
def _is_registered_smart_pointer_creator( self, creator, db ):
for registered in db:
if not isinstance( creator, registered.__class__ ):
@@ -292,7 +276,6 @@
creators = []
created_value_traits = set()
-
for cls in self.__get_exposed_containers():
self.__print_readme( cls )
@@ -322,6 +305,12 @@
self.__extmodule.adopt_declaration_creator( element_type_cc )
cls_creator.adopt_creator( code_creators.indexing_suite2_t(cls) )
+ scfo = self.__std_containers_free_operators
+ if cls in scfo:
+ for operator in scfo[cls]:
+ self.__dependencies_manager.add_exported( operator )
+ cls_creator.adopt_creator( code_creators.operator_t( operator=operator ) )
+
creators.reverse()
self.__module_body.adopt_creators( creators, 0 )
@@ -535,8 +524,18 @@
def visit_free_operator( self ):
self.__types_db.update( self.curr_decl )
- self.__free_operators.append( self.curr_decl )
+ operator = self.curr_decl
+ target_class = operator.target_class
+ scfo = self.__std_containers_free_operators
+ if target_class and target_class.indexing_suite:
+ if target_class not in scfo:
+ scfo[ target_class ] = [ operator ]
+ else:
+ scfo[ target_class ].append( operator )
+ else:
+ self.__free_operators.append( self.curr_decl )
+
def visit_class_declaration(self ):
pass
Modified: pyplusplus_dev/unittests/data/operators_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/operators_to_be_exported.hpp 2008-11-22 21:36:02 UTC (rev 1450)
+++ pyplusplus_dev/unittests/data/operators_to_be_exported.hpp 2008-11-23 20:53:20 UTC (rev 1451)
@@ -65,18 +65,33 @@
namespace PointsUtils{
struct VecOfInts{};
- //typedef std::vector<int> VecOfInts;
}
- class Class2 {
+ class Class {
int i;
};
+ //this one should not be generated
extern PointsUtils::VecOfInts&
- operator += ( PointsUtils::VecOfInts &vec, const Class2&){
+ operator += ( PointsUtils::VecOfInts &vec, const Class&){
return vec;
}
}
+namespace Geometry2{
+ namespace PointsUtils2{
+ typedef std::vector<int> VecOfInts2;
+ }
+
+ class Class2 {
+ int i;
+ };
+
+ extern PointsUtils2::VecOfInts2&
+ operator += ( PointsUtils2::VecOfInts2 &vec, const Class2&){
+ return vec;
+ }
+}
+
#endif//__operators_to_be_exported_hpp__
Modified: pyplusplus_dev/unittests/operators_tester.py
===================================================================
--- pyplusplus_dev/unittests/operators_tester.py 2008-11-22 21:36:02 UTC (rev 1450)
+++ pyplusplus_dev/unittests/operators_tester.py 2008-11-23 20:53:20 UTC (rev 1451)
@@ -66,6 +66,8 @@
mb.namespace( 'Geometry' ).include()
mb.namespace( 'Geometry' ).class_( 'VecOfInts' ).exclude()
+ mb.namespace( 'Geometry2' ).include()
+
def run_tests(self, module):
pyrational = module.pyrational
self.failUnless( pyrational( 28, 7) == 4 )
@@ -100,6 +102,15 @@
y = module.YYY()
print str( y )
+ vec = module.vector_less__int__greater_()
+ ins_cls_2 = module.Class2()
+ vec += ins_cls_2
+
+ ins_cls_1 = module.Class()
+ def tmp():
+ vec += ins_cls_1
+ self.failIfNotRaisesAny( tmp )
+
def create_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite(tester_t))
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2008-11-22 21:36:02 UTC (rev 1450)
+++ pyplusplus_dev/unittests/test_all.py 2008-11-23 20:53:20 UTC (rev 1451)
@@ -312,6 +312,7 @@
if __name__ == "__main__":
+ os.nice( 20 )
runner = process_tester_runner_t( testers )
runner()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-22 22:55:26
|
Revision: 1450
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1450&view=rev
Author: roman_yakovenko
Date: 2008-11-22 21:36:02 +0000 (Sat, 22 Nov 2008)
Log Message:
-----------
small refactoring, which moves "free operators" target class logic out of creator_t class
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
pyplusplus_dev/pyplusplus/module_creator/creator.py
pyplusplus_dev/unittests/data/operators_to_be_exported.hpp
pyplusplus_dev/unittests/indexing_suites2_tester.py
pyplusplus_dev/unittests/operators_tester.py
Modified: pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py
===================================================================
--- pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2008-11-01 19:04:11 UTC (rev 1449)
+++ pyplusplus_dev/pyplusplus/decl_wrappers/calldef_wrapper.py 2008-11-22 21:36:02 UTC (rev 1450)
@@ -400,9 +400,35 @@
included = filter( lambda decl: decl.ignore == False, oper.class_types )
if not included:
return messages.W1052 % str(oper)
-
return ''
+ @staticmethod
+ def target_class( oper ):
+ """this functions returns reference to class/class declaration
+ in scope of which, the operator should be exposed."""
+ if isinstance( oper.parent, declarations.class_t ):
+ return oper.parent
+ #now we deal with free operators
+ def find_class( type_ ):
+ type_ = declarations.remove_reference( type_ )
+ if declarations.is_class( type_ ):
+ return declarations.class_traits.get_declaration( type_ )
+ elif declarations.is_class_declaration( type_ ):
+ return declarations.class_declaration_traits.get_declaration( type_ )
+ else:
+ return None
+
+ arg_1_class = find_class( oper.arguments[0].type )
+ arg_2_class = None
+ if 2 == len( oper.arguments ):
+ arg_2_class = find_class( oper.arguments[1].type )
+
+ if arg_1_class:
+ return arg_1_class
+ else:
+ return arg_2_class
+
+
class member_operator_t( declarations.member_operator_t, calldef_t ):
"""defines a set of properties, that will instruct Py++ how to expose the member operator"""
def __init__(self, *arguments, **keywords):
@@ -446,6 +472,9 @@
return messages.W1015
return operators_helper.exportable( self )
+ @property
+ def target_class( self ):
+ return self.parent
class casting_operator_t( declarations.casting_operator_t, calldef_t ):
"""defines a set of properties, that will instruct Py++ how to expose the casting operator"""
@@ -557,6 +586,22 @@
def __init__(self, *arguments, **keywords):
declarations.free_operator_t.__init__( self, *arguments, **keywords )
calldef_t.__init__( self )
+ self._target_class = None
def _exportable_impl_derived( self ):
return operators_helper.exportable( self )
+
+ def get_target_class( self ):
+ if self._target_class is None:
+ self._target_class = operators_helper.target_class( self )
+ return self._target_class
+
+ def set_target_class( self, class_ ):
+ self._target_class = class_
+
+ _target_class_doc_ = "reference to class_t or class_declaration_t object." \
+ + " There are use cases, where Py++ doesn't guess right, in what scope" \
+ + " free operator should be registered( exposed ). If this is your use case " \
+ + " than setting the class will allow you to quickly fix the situation. "
+
+ target_class = property( get_target_class, set_target_class, doc=_target_class_doc_ )
Modified: pyplusplus_dev/pyplusplus/module_creator/creator.py
===================================================================
--- pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-11-01 19:04:11 UTC (rev 1449)
+++ pyplusplus_dev/pyplusplus/module_creator/creator.py 2008-11-22 21:36:02 UTC (rev 1450)
@@ -174,7 +174,14 @@
pass
else:
assert not "Found %d class code creators" % len(creator)
+
find = code_creators.creator_finder.find_by_declaration
+ if operator.target_class and operator.target_class.ignore == False:
+ found = find( lambda decl: operator.target_class is decl
+ , self.__extmodule.body.creators )
+ adopt_operator_impl( operator, found )
+ """
+ find = code_creators.creator_finder.find_by_declaration
if isinstance( operator.parent, declarations.class_t ):
found = find( lambda decl: operator.parent is decl
, self.__extmodule.body.creators )
@@ -190,7 +197,7 @@
found = find( lambda decl: included[0] is decl, self.__extmodule.body.creators )
adopt_operator_impl( operator, found )
-
+ """
def _is_registered_smart_pointer_creator( self, creator, db ):
for registered in db:
if not isinstance( creator, registered.__class__ ):
@@ -254,20 +261,20 @@
cls_creator.associated_decl_creators.extend( uc_creators )
def __get_exposed_containers(self):
- """list of exposed declarations, which were not ``included``, but still
+ """list of exposed declarations, which were not ``included``, but still
were exposed. For example, std containers
-
+
std containers exposed by Py++, even if the user didn't ``include`` them.
"""
cmp_by_name = lambda cls1, cls2: cmp( cls1.decl_string, cls2.decl_string )
used_containers = list( self.__types_db.used_containers )
used_containers = filter( lambda cls: cls.indexing_suite.include_files
, used_containers )
- used_containers.sort( cmp_by_name )
+ used_containers.sort( cmp_by_name )
used_containers = filter( lambda cnt: cnt.already_exposed == False
, used_containers )
return used_containers
-
+
def _treat_indexing_suite( self ):
def create_explanation(cls):
msg = '//WARNING: the next line of code will not compile, because "%s" does not have operator== !'
Modified: pyplusplus_dev/unittests/data/operators_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/operators_to_be_exported.hpp 2008-11-01 19:04:11 UTC (rev 1449)
+++ pyplusplus_dev/unittests/data/operators_to_be_exported.hpp 2008-11-22 21:36:02 UTC (rev 1450)
@@ -8,21 +8,22 @@
#include "boost/rational.hpp"
#include <iostream>
+#include <vector>
namespace pyplusplus{ namespace rational{
typedef boost::rational< long int > pyrational;
struct helper{
-
+
void instantiate(){
sizeof( pyrational );
boost::gcd<long int>( 1, 1);
boost::lcm<long int>( 1, 1);
- std::cout << pyrational( 1,1);
+ std::cout << pyrational( 1,1);
pyrational x(1,1);
x = pyrational( 2, 3 );
-
+
}
};
@@ -36,14 +37,46 @@
//Boost.Python does not support member operator<<
struct YYY{
- std::ostream& operator<<(std::ostream& s) const{
+ std::ostream& operator<<(std::ostream& s) const{
return s;
//return s << "<YYY instance at " << reinterpret_cast<unsigned long>( this )<< ">";
}
};
+typedef std::vector< pyrational > rationals_t;
+inline rationals_t&
+operator+=( rationals_t& v, const pyrational& n ){
+ for( rationals_t::iterator i = v.begin(); i != v.end(); ++i ){
+ *i += n;
+ }
+ return v;
+}
+
+inline rationals_t create_randome_rationals(){
+ return rationals_t();
+}
+
+
} }
-
+
+namespace Geometry{
+
+ namespace PointsUtils{
+ struct VecOfInts{};
+ //typedef std::vector<int> VecOfInts;
+ }
+
+ class Class2 {
+ int i;
+ };
+
+ extern PointsUtils::VecOfInts&
+ operator += ( PointsUtils::VecOfInts &vec, const Class2&){
+ return vec;
+ }
+}
+
+
#endif//__operators_to_be_exported_hpp__
Modified: pyplusplus_dev/unittests/indexing_suites2_tester.py
===================================================================
--- pyplusplus_dev/unittests/indexing_suites2_tester.py 2008-11-01 19:04:11 UTC (rev 1449)
+++ pyplusplus_dev/unittests/indexing_suites2_tester.py 2008-11-22 21:36:02 UTC (rev 1450)
@@ -25,6 +25,11 @@
items = generator.global_ns.typedef( 'items_t' )
items = declarations.remove_declarated( items.type )
items.alias = "items_t"
+
+ strings = generator.global_ns.typedef( 'strings_t' )
+ strings = declarations.remove_declarated( strings.type )
+ strings.include()
+
fvector = generator.global_ns.typedef( 'fvector' )
fvector = declarations.remove_declarated( fvector.type )
fvector.indexing_suite.disable_method( 'extend' )
Modified: pyplusplus_dev/unittests/operators_tester.py
===================================================================
--- pyplusplus_dev/unittests/operators_tester.py 2008-11-01 19:04:11 UTC (rev 1449)
+++ pyplusplus_dev/unittests/operators_tester.py 2008-11-22 21:36:02 UTC (rev 1450)
@@ -22,6 +22,8 @@
def customize( self, mb ):
mb.global_ns.exclude()
+ mb.free_function( 'create_randome_rationals' ).include()
+
xxx = mb.class_( 'XXX' )
xxx.include()
xxx_ref = declarations.reference_t( declarations.const_t( declarations.declarated_t( xxx ) ) )
@@ -61,6 +63,8 @@
bad_rational = mb.class_('bad_rational' )
bad_rational.include()
+ mb.namespace( 'Geometry' ).include()
+ mb.namespace( 'Geometry' ).class_( 'VecOfInts' ).exclude()
def run_tests(self, module):
pyrational = module.pyrational
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-01 19:04:15
|
Revision: 1449
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1449&view=rev
Author: roman_yakovenko
Date: 2008-11-01 19:04:11 +0000 (Sat, 01 Nov 2008)
Log Message:
-----------
adding new test case
Modified Paths:
--------------
pyplusplus_dev/unittests/test_all.py
Added Paths:
-----------
pyplusplus_dev/unittests/data/protected_bug_to_be_exported.hpp
pyplusplus_dev/unittests/protected_bug_tester.py
Added: pyplusplus_dev/unittests/data/protected_bug_to_be_exported.hpp
===================================================================
--- pyplusplus_dev/unittests/data/protected_bug_to_be_exported.hpp (rev 0)
+++ pyplusplus_dev/unittests/data/protected_bug_to_be_exported.hpp 2008-11-01 19:04:11 UTC (rev 1449)
@@ -0,0 +1,66 @@
+template<class T>
+class ref_ptr
+{
+};
+
+template<class T>
+class buffered_value
+{
+public:
+ buffered_value() {}
+ buffered_value(unsigned int size) {}
+ buffered_value& operator = (const buffered_value& rhs) {}
+};
+
+class Referenced
+{
+public:
+ Referenced() {}
+ Referenced(const Referenced&) {}
+protected:
+ virtual ~Referenced() {}
+};
+
+class Object : public Referenced
+{
+public:
+ Object() {}
+ virtual const char* className() const = 0;
+
+protected:
+ virtual ~Object() {}
+};
+
+class Shader : public Object
+{
+public:
+
+ virtual const char* className() const { return "Shader"; }
+
+ Shader() {}
+ Shader(const char *source ) {}
+
+protected:
+ class PerContextShader : public Referenced
+ {
+ public:
+ PerContextShader(const Shader* shader, unsigned int contextID) {}
+
+ protected:
+ ~PerContextShader() {}
+
+ private:
+ PerContextShader() {}
+ PerContextShader(const PerContextShader&) {}
+ PerContextShader& operator=(const PerContextShader&) {}
+ };
+
+protected:
+ virtual ~Shader() {}
+
+ PerContextShader* getPCS(unsigned int contextID) const {}
+
+protected:
+ mutable buffered_value< ref_ptr<PerContextShader> > _pcsList;
+};
+
Added: pyplusplus_dev/unittests/protected_bug_tester.py
===================================================================
--- pyplusplus_dev/unittests/protected_bug_tester.py (rev 0)
+++ pyplusplus_dev/unittests/protected_bug_tester.py 2008-11-01 19:04:11 UTC (rev 1449)
@@ -0,0 +1,47 @@
+# Copyright 2004-2008 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)
+
+import os
+import sys
+import unittest
+import fundamental_tester_base
+from pygccxml import declarations
+from pyplusplus import code_creators
+
+class tester_t(fundamental_tester_base.fundamental_tester_base_t):
+ EXTENSION_NAME = 'protected_bug'
+
+ def __init__( self, *args ):
+ fundamental_tester_base.fundamental_tester_base_t.__init__(
+ self
+ , tester_t.EXTENSION_NAME
+ , *args )
+
+ def customize(self, mb ):
+ access_type_matcher = declarations.access_type_matcher_t
+ mb.global_ns.include()
+ mb.classes( access_type_matcher('protected') ).exclude()
+ mb.vars( access_type_matcher('protected') ).exclude()
+ mb.class_( lambda d: d.name.startswith( 'buffered_value' ) ).exclude()
+ for cls in mb.classes():
+ if declarations.has_destructor(cls) \
+ and cls.calldef(lambda d: d.name.startswith('~'), recursive=False).access_type == 'protected':
+ print 'protected destructor: ', str( cls )
+ cls.constructors().exclude()
+ cls.noncopyable = True
+
+ def run_tests( self, module):
+ pass
+
+def create_suite():
+ suite = unittest.TestSuite()
+ suite.addTest( unittest.makeSuite(tester_t))
+ return suite
+
+def run_suite():
+ unittest.TextTestRunner(verbosity=2).run( create_suite() )
+
+if __name__ == "__main__":
+ run_suite()
Modified: pyplusplus_dev/unittests/test_all.py
===================================================================
--- pyplusplus_dev/unittests/test_all.py 2008-11-01 08:09:25 UTC (rev 1448)
+++ pyplusplus_dev/unittests/test_all.py 2008-11-01 19:04:11 UTC (rev 1449)
@@ -57,6 +57,7 @@
import factory_tester
import private_assign_tester
import protected_tester
+import protected_bug_tester
import indexing_suites_tester
import indexing_suites2_tester
import hierarchy3_tester
@@ -206,6 +207,7 @@
, cp_return_addressof_tester
, make_constructor_tester
, return_auto_ptr_tester
+ , protected_bug_tester
# , ogre_generate_tester too much time
]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-11-01 08:09:27
|
Revision: 1448
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1448&view=rev
Author: roman_yakovenko
Date: 2008-11-01 08:09:25 +0000 (Sat, 01 Nov 2008)
Log Message:
-----------
adding new tester
Modified Paths:
--------------
pygccxml_dev/unittests/test_all.py
Added Paths:
-----------
pygccxml_dev/unittests/data/classes.hpp
pygccxml_dev/unittests/declaration_matcher_tester.py
Added: pygccxml_dev/unittests/data/classes.hpp
===================================================================
--- pygccxml_dev/unittests/data/classes.hpp (rev 0)
+++ pygccxml_dev/unittests/data/classes.hpp 2008-11-01 08:09:25 UTC (rev 1448)
@@ -0,0 +1,17 @@
+// Copyright 2004-2008 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)
+
+#ifndef __classes_hpp__
+#define __classes_hpp__
+
+struct cls{};
+
+namespace ns{
+
+ struct nested_cls{};
+
+}
+
+#endif//__classes_hpp__
Added: pygccxml_dev/unittests/declaration_matcher_tester.py
===================================================================
--- pygccxml_dev/unittests/declaration_matcher_tester.py (rev 0)
+++ pygccxml_dev/unittests/declaration_matcher_tester.py 2008-11-01 08:09:25 UTC (rev 1448)
@@ -0,0 +1,56 @@
+# Copyright 2004-2008 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)
+
+import os
+import unittest
+import autoconfig
+import parser_test_case
+
+from pygccxml import utils
+from pygccxml import parser
+from pygccxml import declarations
+
+class tester_t( parser_test_case.parser_test_case_t ):
+ global_ns = None
+ COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE
+ def __init__(self, *args ):
+ parser_test_case.parser_test_case_t.__init__( self, *args )
+ self.header = 'classes.hpp'
+ self.global_ns = None
+
+ def setUp(self):
+ if not tester_t.global_ns:
+ decls = parser.parse( [self.header], self.config )
+ tester_t.global_ns = declarations.get_global_namespace( decls )
+ tester_t.global_ns.init_optimizer()
+ self.global_ns = tester_t.global_ns
+
+ def test_global( self ):
+ gns = self.global_ns
+ gns.class_( 'cls' )
+ gns.class_( '::cls' )
+
+ def test_ns1( self ):
+ gns = self.global_ns
+ ns1 = gns.namespace( 'ns' )
+
+ gns.class_( 'nested_cls' )
+ self.failUnlessRaises( Exception, lambda: gns.class_( 'ns::nested_cls' ) )
+ gns.class_( '::ns::nested_cls' )
+
+ self.failUnlessRaises( Exception, lambda: ns1.class_( '::nested_cls' ) )
+ ns1.class_( 'nested_cls' )
+ ns1.class_( '::ns::nested_cls' )
+
+def create_suite():
+ suite = unittest.TestSuite()
+ suite.addTest( unittest.makeSuite(tester_t))
+ return suite
+
+def run_suite():
+ unittest.TextTestRunner(verbosity=2).run( create_suite() )
+
+if __name__ == "__main__":
+ run_suite()
Modified: pygccxml_dev/unittests/test_all.py
===================================================================
--- pygccxml_dev/unittests/test_all.py 2008-10-26 13:00:57 UTC (rev 1447)
+++ pygccxml_dev/unittests/test_all.py 2008-11-01 08:09:25 UTC (rev 1448)
@@ -51,6 +51,7 @@
import plain_c_tester
import function_traits_tester
import better_templates_matcher_tester
+import declaration_matcher_tester
testers = [
decl_string_tester
@@ -98,6 +99,7 @@
, plain_c_tester
, function_traits_tester
, better_templates_matcher_tester
+ , declaration_matcher_tester
]
def create_suite():
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-26 13:01:03
|
Revision: 1447
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1447&view=rev
Author: roman_yakovenko
Date: 2008-10-26 13:00:57 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
adding textcha
Modified Paths:
--------------
ui/web/forms.py
ui/web/templates/generated.html
ui/web/templates/generator.html
Added Paths:
-----------
ui/web/static/generator.css
ui/web/textcha.py
Modified: ui/web/forms.py
===================================================================
--- ui/web/forms.py 2008-10-23 05:40:53 UTC (rev 1446)
+++ ui/web/forms.py 2008-10-26 13:00:57 UTC (rev 1447)
@@ -1,96 +1,91 @@
-import config
-import web
-
-class Label(web.form.Input):
- tmpl = """<label name="%(name)s" %(atts)s>%(value)s</label>%(note)s"""
- def render(self):
- value = ''
- if self.value is not None:
- value = web.net.websafe(self.value)
- return self.tmpl % dict( name=web.net.websafe(self.name)
- , value=value
- , atts=self.addatts()
- , note=self.rendernote(self.note) )
-
-class RawHTML(web.form.Input):
- def __init__(self, html, *validators, **attrs):
- web.form.Input.__init__( self, '', *validators, **attrs )
- self.__html = html
- def render(self):
- return self.__html
-
-class SimpleForm( web.form.Form ):
- tmpl = """<form %(attrs)s>\n%(inputs)s\n</form>\n"""
- def __init__(self, *inputs, **kw):
- web.form.Form.__init__( self, *inputs, **kw )
- self.__kw = kw
- self.__kw.pop( 'validators', None )
-
- def render_addattrs( self ):
- attrs = []
- for (n, v) in self.__kw.iteritems():
- attrs.append( ' %s="%s"' % (n, web.net.websafe(v)) )
- return ''.join( attrs )
-
- def render( self ):
- controls = []
- controls.append( self.rendernote(self.note) )
- for i in self.inputs:
- if i.pre:
- controls.append( i.pre )
- controls.append( i.render() )
- if i.post:
- controls.append( i.post )
- return self.tmpl % dict( attrs=self.render_addattrs(), inputs='\n'.join( controls ) )
-
-
-"""
- <form action="/generated.html" method="post" id="SourceCodeForm" style="width:80%; float:left;">
- <label>Source code:</label>
- <br/>
- <textarea name="source_code" rows="20" style="width:100%;"></textarea>
- <br/>
- <input type="submit" name="show_decls" value="Show declarations" />
- <a></a>
- <input type="submit" name="generate_bp" value="Generate Boost.Python code" />
- <a></a>
- <input type="submit" name="generate_pypp" value="Generate Py++ code" />
- </form>
-"""
-
-
-class generator_t( SimpleForm ):
- def __init__( self, action, code_generator=None, method='post' ):
- self.__code_generator = code_generator
- self.__show_decls = web.form.Button( 'Show declarations', type="submit" )
- self.__generate_bpl_code = web.form.Button( 'Generate Boost.Python code', type="submit" )
- self.__generate_pypp_code = web.form.Button( 'Generate Py++ code', id="generate_pypp_code", type="submit" )
- self.__source_code = web.form.Textarea( "source_code", rows="20", style="width:100%;")
- SimpleForm.__init__( self
- , Label( 'source_code', value="Source code:" )
- , RawHTML( '<br/>' )
- , self.__source_code
- , RawHTML( '<br/>' )
- , self.__show_decls
- , RawHTML( '<a></a>' )
- , self.__generate_bpl_code
- , RawHTML( '<a></a>' )
- , self.__generate_pypp_code
- , action=action
- , method=method
- , style="width:80%; float:left;" )
-
- def process( self, request_data ):
- warnings = ''
- generated = ''
- source_code = request_data[ self.__source_code.name]
- if self.__show_decls.name in request_data:
- generated = self.__code_generator.show_declarations( source_code )
- elif self.__generate_pypp_code.name in request_data:
- generated = self.__code_generator.generate_pypp_code( source_code )
- elif self.__generate_bpl_code.name in request_data:
- generated, warnings = self.__code_generator.generate_bpl_code( source_code )
- else:
- generated = 'error - unknown submit action'
- return generated, warnings
-
+import config
+import web
+import textcha
+
+class Label(web.form.Input):
+ tmpl = """<label name="%(name)s" %(atts)s>%(value)s</label>%(note)s"""
+ def render(self):
+ value = ''
+ if self.value is not None:
+ value = web.net.websafe(self.value)
+ return self.tmpl % dict( name=web.net.websafe(self.name)
+ , value=value
+ , atts=self.addatts()
+ , note=self.rendernote(self.note) )
+
+class RawHTML(web.form.Input):
+ def __init__(self, html, *validators, **attrs):
+ web.form.Input.__init__( self, '', *validators, **attrs )
+ self.__html = html
+ def render(self):
+ return self.__html
+
+class SimpleForm( web.form.Form ):
+ tmpl = """<form %(attrs)s>\n%(inputs)s\n</form>\n"""
+ def __init__(self, *inputs, **kw):
+ web.form.Form.__init__( self, *inputs, **kw )
+ self.__kw = kw
+ self.__kw.pop( 'validators', None )
+
+ def render_addattrs( self ):
+ attrs = []
+ for (n, v) in self.__kw.iteritems():
+ attrs.append( ' %s="%s"' % (n, web.net.websafe(v)) )
+ return ''.join( attrs )
+
+ def render( self ):
+ controls = []
+ controls.append( self.rendernote(self.note) )
+ for i in self.inputs:
+ if i.pre:
+ controls.append( i.pre )
+ controls.append( i.render() )
+ if i.post:
+ controls.append( i.post )
+ return self.tmpl % dict( attrs=self.render_addattrs(), inputs='\n'.join( controls ) )
+
+
+class generator_t( SimpleForm ):
+ def __init__( self, action, code_generator=None, method='post' ):
+ self.__code_generator = code_generator
+ self.__show_decls = web.form.Button( 'Show declarations', type="submit" )
+ self.__generate_bpl_code = web.form.Button( 'Generate Boost.Python code', type="submit" )
+ self.__generate_pypp_code = web.form.Button( 'Generate Py++ code', id="generate_pypp_code", type="submit" )
+ self.__source_code = web.form.Textarea( "source_code", rows="20", style="width:100%")
+ self.__textcha_question = web.form.Hidden( "textcha_question", value=textcha.random_question(), style="width:60%;", id='textcha-question')
+ self.__textcha_answer = web.form.Textbox( "textcha_answer", value="", style="width:40%;", maxlength="120", id='textcha-answer')
+ SimpleForm.__init__( self
+ , Label( 'source_code', value="Source code:" )
+ , RawHTML( '<br/>' )
+ , self.__source_code
+ , RawHTML( '<br/>' )
+ , self.__textcha_question
+ , Label( 'textcha_question', value=self.__textcha_question.value )
+ , self.__textcha_answer
+ , RawHTML( '<br/><br/>' )
+ , self.__show_decls
+ , RawHTML( '<a></a>' )
+ , self.__generate_bpl_code
+ , RawHTML( '<a></a>' )
+ , self.__generate_pypp_code
+ , action=action
+ , method=method
+ , style="width:80%; float:left;" )
+
+ def process( self, request_data ):
+ warnings = ''
+ generated = ''
+ if not textcha.is_human( request_data[ self.__textcha_question.name], request_data[ self.__textcha_answer.name] ):
+ generated = warnings = "Please answer the question!"
+ return generated, warnings
+ source_code = request_data[ self.__source_code.name]
+ if self.__show_decls.name in request_data:
+ generated = self.__code_generator.show_declarations( source_code )
+ elif self.__generate_pypp_code.name in request_data:
+ generated = self.__code_generator.generate_pypp_code( source_code )
+ elif self.__generate_bpl_code.name in request_data:
+ generated, warnings = self.__code_generator.generate_bpl_code( source_code )
+ else:
+ generated = 'error - unknown submit action'
+ return generated, warnings
+
Added: ui/web/static/generator.css
===================================================================
--- ui/web/static/generator.css (rev 0)
+++ ui/web/static/generator.css 2008-10-26 13:00:57 UTC (rev 1447)
@@ -0,0 +1,13 @@
+#textcha {
+ font-size: 100%;
+ margin-top: 0.5em;
+ border: 2px solid #FF8888;
+ color: black;
+ vertical-align: middle;
+ padding: 3px 2px;
+}
+
+#textcha-answer {
+ border: 2px solid #000000;
+ padding: 3px 2px;
+}
Modified: ui/web/templates/generated.html
===================================================================
--- ui/web/templates/generated.html 2008-10-23 05:40:53 UTC (rev 1446)
+++ ui/web/templates/generated.html 2008-10-26 13:00:57 UTC (rev 1447)
@@ -1,35 +1,36 @@
-$def with (code, warnings)
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="shortcut icon" href="/static/favicon.ico" />
- <link rel="icon" href="/static/favicon.ico" />
- <title>pygccxml & py++ demo - generated code</title>
-</head>
-<body>
- <h2>pygccxml & py++ demo - generated code</h2>
- <span style="width:80%; float:left;">
- <label>Generated code:</label>
- <br/>
- <textarea name="generated_code" rows="20" readonly="true" style="width:100%;">$:code</textarea>
- </span>
- <a> </a>
- <span style="float : left; padding-left : 10px; width : 18%;">
- <br/>
- <label style="width:100%;">What is ... ?</label>
- <dt>
- <dd><a href="http://www.language-binding.net">py++</a></dd>
- <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
- </dt>
- <label style="width:100%;">Adsense placeholder</label>
- <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
- </span>
- <span style="width:100%;">
- <br/>
- <label>Warnings:</label>
- <br/>
- <textarea name="warnings" rows="15" readonly="true" style="width:100%;">$:warnings</textarea>
- </span>
-</body>
-</html>
+$def with (code, warnings)
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="shortcut icon" href="/static/favicon.ico" />
+ <link rel="icon" href="/static/favicon.ico" />
+ <!--link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/static/generator.css"-->
+ <title>pygccxml & py++ demo - generated code</title>
+</head>
+<body>
+ <h2>pygccxml & py++ demo - generated code</h2>
+ <span style="width:80%; float:left;">
+ <label>Generated code:</label>
+ <br/>
+ <textarea name="generated_code" rows="20" readonly="true" style="width:100%;">$:code</textarea>
+ </span>
+ <a> </a>
+ <span style="float : left; padding-left : 10px; width : 18%;">
+ <br/>
+ <label style="width:100%;">What is ... ?</label>
+ <dt>
+ <dd><a href="http://www.language-binding.net">py++</a></dd>
+ <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
+ </dt>
+ <label style="width:100%;">Adsense placeholder</label>
+ <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
+ </span>
+ <span style="width:100%;">
+ <br/>
+ <label>Warnings:</label>
+ <br/>
+ <textarea name="warnings" rows="15" readonly="true" style="width:100%;">$:warnings</textarea>
+ </span>
+</body>
+</html>
Modified: ui/web/templates/generator.html
===================================================================
--- ui/web/templates/generator.html 2008-10-23 05:40:53 UTC (rev 1446)
+++ ui/web/templates/generator.html 2008-10-26 13:00:57 UTC (rev 1447)
@@ -1,25 +1,26 @@
-$def with (generator_form)
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="shortcut icon" href="/static/favicon.ico" />
- <link rel="icon" href="/static/favicon.ico" />
- <title>pygccxml & py++ demo</title>
-</head>
-<body>
- <h2>pygccxml & py++ demo</h2>
- $:generator_form.render()
- <a> </a>
- <span style="float : left; padding-left : 10px; width : 18%;">
- <br/>
- <label style="width:100;">What is ... ?</label>
- <dt>
- <dd><a href="http://www.language-binding.net">py++</a></dd>
- <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
- </dt>
- <label style="width:100;">Adsense placeholder</label>
- <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
- </span>
-</body>
-</html>
+$def with (generator_form)
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="shortcut icon" href="/static/favicon.ico" />
+ <link rel="icon" href="/static/favicon.ico" />
+ <!--link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="/static/generator.css"-->
+ <title>pygccxml & py++ demo</title>
+</head>
+<body>
+ <h2>pygccxml & py++ demo</h2>
+ $:generator_form.render()
+ <a> </a>
+ <span style="float : left; padding-left : 10px; width : 18%;">
+ <br/>
+ <label style="width:100;">What is ... ?</label>
+ <dt>
+ <dd><a href="http://www.language-binding.net">py++</a></dd>
+ <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
+ </dt>
+ <label style="width:100;">Adsense placeholder</label>
+ <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
+ </span>
+</body>
+</html>
Added: ui/web/textcha.py
===================================================================
--- ui/web/textcha.py (rev 0)
+++ ui/web/textcha.py 2008-10-26 13:00:57 UTC (rev 1447)
@@ -0,0 +1,20 @@
+import re
+import random
+import config
+
+questions = {
+ 'Which programming language does the pygccxml project mainly use?' : re.compile( '\s*python\s*' )
+}
+
+question_keys = questions.keys()
+question_keys_len = len(question_keys)
+
+def random_question():
+ return question_keys[ random.randrange( question_keys_len ) ]
+
+def is_human( question, answer ):
+ if question not in questions:
+ return False
+ return questions[question].match( answer.lower() )
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-23 05:40:56
|
Revision: 1446
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1446&view=rev
Author: roman_yakovenko
Date: 2008-10-23 05:40:53 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
concentrating all UI modules in a single place
Modified Paths:
--------------
pyplusplus_dev/setup.py
ui/ide/_dev_run_ide_.py
ui/simple/ui.py
ui/simple/ui_runner.py
Added Paths:
-----------
ui/ide/
ui/simple/
Removed Paths:
-------------
pyplusplus_dev/ide/
pyplusplus_dev/pyplusplus/gui/
Modified: pyplusplus_dev/setup.py
===================================================================
--- pyplusplus_dev/setup.py 2008-10-22 21:55:39 UTC (rev 1445)
+++ pyplusplus_dev/setup.py 2008-10-23 05:40:53 UTC (rev 1446)
@@ -98,7 +98,6 @@
scripts = ["scripts/pyplusplus_gui",
"scripts/pyplusplus_gui.pyw"],
packages=[ 'pyplusplus',
- 'pyplusplus.gui',
'pyplusplus.file_writers',
'pyplusplus.code_creators',
'pyplusplus.module_creator',
Property changes on: ui/ide
___________________________________________________________________
Added: svn:ignore
+ .settings
.project
.pydevproject
Added: svn:mergeinfo
+
Modified: ui/ide/_dev_run_ide_.py
===================================================================
--- pyplusplus_dev/ide/_dev_run_ide_.py 2008-10-22 21:55:39 UTC (rev 1445)
+++ ui/ide/_dev_run_ide_.py 2008-10-23 05:40:53 UTC (rev 1446)
@@ -1,11 +1,11 @@
import sys
-sys.path.append( '..' )
sys.path.append( '../../pygccxml_dev' )
+sys.path.append( '../../pyplusplus_dev' )
import pygccxml
import pyplusplus
import ide
-ide.main()
\ No newline at end of file
+ide.main()
Property changes on: ui/simple
___________________________________________________________________
Added: svn:ignore
+ *.pyc
Added: svn:mergeinfo
+
Modified: ui/simple/ui.py
===================================================================
--- pyplusplus_dev/pyplusplus/gui/ui.py 2008-10-22 21:55:39 UTC (rev 1445)
+++ ui/simple/ui.py 2008-10-23 05:40:53 UTC (rev 1446)
@@ -117,8 +117,9 @@
this_module_dir_path = os.path.abspath ( os.path.dirname( sys.modules[__name__].__file__) )
this_module_dir_path = this_module_dir_path.replace( '\\', '/' )
this_module_dir_path = this_module_dir_path.lower()
- if this_module_dir_path.endswith( '/sources/pyplusplus_dev/pyplusplus/gui' ):
- gccxml_09_path = os.path.join( this_module_dir_path, '..', '..', '..', 'gccxml_bin', 'v09', sys.platform, 'bin' )
+ if this_module_dir_path.endswith( 'sources/ui/simple' ):
+ gccxml_09_path = os.path.join( this_module_dir_path, '..', '..', 'gccxml_bin', 'v09', sys.platform, 'bin' )
+
self._gccxml_location.insert( 0, gccxml_09_path )
def _select_gccxml_executable( self ):
Modified: ui/simple/ui_runner.py
===================================================================
--- pyplusplus_dev/pyplusplus/gui/ui_runner.py 2008-10-22 21:55:39 UTC (rev 1445)
+++ ui/simple/ui_runner.py 2008-10-23 05:40:53 UTC (rev 1446)
@@ -13,11 +13,18 @@
import os
import sys
-#pygccxml
-sys.path.append( os.path.abspath( './../../../pygccxml_dev' ) )
-#pyplusplus
-sys.path.append( os.path.abspath( './../..' ) )
+this_module_dir_path = os.path.abspath ( os.path.dirname( sys.modules[__name__].__file__) )
+projects_root_dir = os.path.dirname( os.path.dirname( this_module_dir_path ) )
+sys.path.insert( 0, os.path.join( this_module_dir_path, 'web.zip' ) )
+
+if os.path.exists( os.path.join( projects_root_dir, 'pygccxml_dev' ) ):
+ sys.path.append( os.path.join( projects_root_dir, 'pygccxml_dev' ) )
+if os.path.exists( os.path.join( projects_root_dir, 'pyplusplus_dev' ) ):
+ sys.path.append( os.path.join( projects_root_dir, 'pyplusplus_dev' ) )
+#else use installed modules
+
+
import ui
if __name__ == '__main__':
- ui.show_demo()
\ No newline at end of file
+ ui.show_demo()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-22 22:49:34
|
Revision: 1444
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1444&view=rev
Author: roman_yakovenko
Date: 2008-10-22 21:53:11 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
adding ability to write log to in memory string
setting propagate to False
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/_logging_/__init__.py
Modified: pyplusplus_dev/pyplusplus/_logging_/__init__.py
===================================================================
--- pyplusplus_dev/pyplusplus/_logging_/__init__.py 2008-10-21 20:29:42 UTC (rev 1443)
+++ pyplusplus_dev/pyplusplus/_logging_/__init__.py 2008-10-22 21:53:11 UTC (rev 1444)
@@ -9,19 +9,29 @@
import os
import sys
import logging
+import cStringIO
from multi_line_formatter import multi_line_formatter_t
-def _create_logger_( name ):
+def create_handler( stream=None ):
+ handler = None
+ if stream:
+ handler = logging.StreamHandler(stream)
+ else:
+ handler = logging.StreamHandler(stream)
+ handler.setFormatter( multi_line_formatter_t( os.linesep + '%(levelname)s: %(message)s' ) )
+ return handler
+
+def _create_logger_( name, stream=None ):
"""implementation details"""
logger = logging.getLogger(name)
- handler = logging.StreamHandler()
- handler.setFormatter( multi_line_formatter_t( os.linesep + '%(levelname)s: %(message)s' ) )
- logger.addHandler(handler)
+ logger.propagate = False
+ logger.addHandler( create_handler(stream) )
logger.setLevel(logging.INFO)
return logger
class loggers:
"""class-namespace, defines few loggers classes, used in the project"""
+ stream = None
file_writer = _create_logger_( 'pyplusplus.file_writer' )
"""logger for classes that write code to files"""
@@ -45,4 +55,10 @@
all = [ root, file_writer, module_builder, declarations ]
"""contains all logger classes, defined by the class"""
-
\ No newline at end of file
+
+ @staticmethod
+ def make_inmemory():
+ loggers.stream = cStringIO.StringIO()
+ for logger in loggers.all:
+ map( lambda h: logger.removeHandler( h ), logger.handlers[:] )
+ logger.addHandler( create_handler( loggers.stream ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-22 22:49:31
|
Revision: 1445
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1445&view=rev
Author: roman_yakovenko
Date: 2008-10-22 21:55:39 +0000 (Wed, 22 Oct 2008)
Log Message:
-----------
adding initial web interface, based on web.py project
Added Paths:
-----------
ui/
ui/web/
ui/web/code_generator.py
ui/web/config.py
ui/web/forms.py
ui/web/main.py
ui/web/static/
ui/web/static/favicon.ico
ui/web/templates/
ui/web/templates/generated.html
ui/web/templates/generated_tmpl.html
ui/web/templates/generator.html
ui/web/templates/generator_tmpl.html
ui/web/web.zip
Property changes on: ui/web
___________________________________________________________________
Added: svn:ignore
+ config.pyc
code_generator.pyc
forms.pyc
main.pyc
Added: ui/web/code_generator.py
===================================================================
--- ui/web/code_generator.py (rev 0)
+++ ui/web/code_generator.py 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,54 @@
+import os
+import config
+from pygccxml import parser
+from pyplusplus import _logging_
+from pygccxml import declarations
+from pyplusplus import module_builder
+
+class manager_t:
+ def __init__( self ):
+ pass
+
+ def show_declarations( self, source_code ):
+ try:
+ reader = parser.source_reader_t( config=config.gccxml )
+ decls = reader.read_string( source_code )
+ global_ns = declarations.get_global_namespace( decls )
+ tmp = []
+ declarations.print_declarations( decls, verbose=False, writer=lambda x: tmp.append( x ) )
+ return '\n'.join( tmp )
+ except Exception, error:
+ user_msg = [ 'Error occured during code generation process!' ]
+ user_msg.append( 'Error:' )
+ user_msg.append( str( error ) )
+ return '\n'.join( user_msg )
+
+
+ def generate_pypp_code( self, source_code ):
+ return "import pyplusplus"
+
+ def generate_bpl_code( self, source_code ):
+ try:
+ _logging_.loggers.make_inmemory()
+
+ f = parser.create_text_fc( source_code )
+ mb = module_builder.module_builder_t( [ f ]
+ , gccxml_path=config.gccxml.gccxml_path )
+ mb.decls( header_dir=config.temp_dir ).include()
+ mb.build_code_creator( "pyplusplus" )
+ code = mb.code_creator.create()
+ code = code.replace( '\n\r', '\n' )
+ code = code.replace( '\r\n', '\n' )
+ warnings = _logging_.loggers.stream.getvalue()
+ _logging_.loggers.stream.close()
+ return code, warnings
+ except Exception, error:
+ user_msg = [ 'Error occured during code generation process!' ]
+ user_msg.append( 'Error:' )
+ user_msg.append( str( error ) )
+ return '\n'.join( user_msg )
+
+if __name__ == '__main__':
+ m = manager_t()
+ m.generate_bpl_code( 'int do_smth( int &);int do_smth( int, int);' )
+
Added: ui/web/config.py
===================================================================
--- ui/web/config.py (rev 0)
+++ ui/web/config.py 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,26 @@
+import os
+import sys
+import getpass
+import tempfile
+
+this_module_dir_path = os.path.abspath ( os.path.dirname( sys.modules[__name__].__file__) )
+projects_root_dir = os.path.dirname( os.path.dirname( this_module_dir_path ) )
+
+sys.path.insert( 0, os.path.join( this_module_dir_path, 'web.zip' ) )
+
+if os.path.exists( os.path.join( projects_root_dir, 'pygccxml_dev' ) ):
+ sys.path.append( os.path.join( projects_root_dir, 'pygccxml_dev' ) )
+if os.path.exists( os.path.join( projects_root_dir, 'pyplusplus_dev' ) ):
+ sys.path.append( os.path.join( projects_root_dir, 'pyplusplus_dev' ) )
+#else use installed modules
+
+from pygccxml import parser
+from pyplusplus import module_builder
+
+gccxml_path = os.path.join( projects_root_dir, 'gccxml_bin', 'v09', sys.platform, 'bin' )
+if os.path.exists( gccxml_path ):
+ gccxml = parser.config_t( gccxml_path=gccxml_path )
+else: #use gccxml from PATH
+ gccxml = parser.config_t()
+
+temp_dir = tempfile.gettempdir()
Added: ui/web/forms.py
===================================================================
--- ui/web/forms.py (rev 0)
+++ ui/web/forms.py 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,96 @@
+import config
+import web
+
+class Label(web.form.Input):
+ tmpl = """<label name="%(name)s" %(atts)s>%(value)s</label>%(note)s"""
+ def render(self):
+ value = ''
+ if self.value is not None:
+ value = web.net.websafe(self.value)
+ return self.tmpl % dict( name=web.net.websafe(self.name)
+ , value=value
+ , atts=self.addatts()
+ , note=self.rendernote(self.note) )
+
+class RawHTML(web.form.Input):
+ def __init__(self, html, *validators, **attrs):
+ web.form.Input.__init__( self, '', *validators, **attrs )
+ self.__html = html
+ def render(self):
+ return self.__html
+
+class SimpleForm( web.form.Form ):
+ tmpl = """<form %(attrs)s>\n%(inputs)s\n</form>\n"""
+ def __init__(self, *inputs, **kw):
+ web.form.Form.__init__( self, *inputs, **kw )
+ self.__kw = kw
+ self.__kw.pop( 'validators', None )
+
+ def render_addattrs( self ):
+ attrs = []
+ for (n, v) in self.__kw.iteritems():
+ attrs.append( ' %s="%s"' % (n, web.net.websafe(v)) )
+ return ''.join( attrs )
+
+ def render( self ):
+ controls = []
+ controls.append( self.rendernote(self.note) )
+ for i in self.inputs:
+ if i.pre:
+ controls.append( i.pre )
+ controls.append( i.render() )
+ if i.post:
+ controls.append( i.post )
+ return self.tmpl % dict( attrs=self.render_addattrs(), inputs='\n'.join( controls ) )
+
+
+"""
+ <form action="/generated.html" method="post" id="SourceCodeForm" style="width:80%; float:left;">
+ <label>Source code:</label>
+ <br/>
+ <textarea name="source_code" rows="20" style="width:100%;"></textarea>
+ <br/>
+ <input type="submit" name="show_decls" value="Show declarations" />
+ <a></a>
+ <input type="submit" name="generate_bp" value="Generate Boost.Python code" />
+ <a></a>
+ <input type="submit" name="generate_pypp" value="Generate Py++ code" />
+ </form>
+"""
+
+
+class generator_t( SimpleForm ):
+ def __init__( self, action, code_generator=None, method='post' ):
+ self.__code_generator = code_generator
+ self.__show_decls = web.form.Button( 'Show declarations', type="submit" )
+ self.__generate_bpl_code = web.form.Button( 'Generate Boost.Python code', type="submit" )
+ self.__generate_pypp_code = web.form.Button( 'Generate Py++ code', id="generate_pypp_code", type="submit" )
+ self.__source_code = web.form.Textarea( "source_code", rows="20", style="width:100%;")
+ SimpleForm.__init__( self
+ , Label( 'source_code', value="Source code:" )
+ , RawHTML( '<br/>' )
+ , self.__source_code
+ , RawHTML( '<br/>' )
+ , self.__show_decls
+ , RawHTML( '<a></a>' )
+ , self.__generate_bpl_code
+ , RawHTML( '<a></a>' )
+ , self.__generate_pypp_code
+ , action=action
+ , method=method
+ , style="width:80%; float:left;" )
+
+ def process( self, request_data ):
+ warnings = ''
+ generated = ''
+ source_code = request_data[ self.__source_code.name]
+ if self.__show_decls.name in request_data:
+ generated = self.__code_generator.show_declarations( source_code )
+ elif self.__generate_pypp_code.name in request_data:
+ generated = self.__code_generator.generate_pypp_code( source_code )
+ elif self.__generate_bpl_code.name in request_data:
+ generated, warnings = self.__code_generator.generate_bpl_code( source_code )
+ else:
+ generated = 'error - unknown submit action'
+ return generated, warnings
+
Added: ui/web/main.py
===================================================================
--- ui/web/main.py (rev 0)
+++ ui/web/main.py 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,27 @@
+import config
+
+import sys
+import web
+import forms
+import code_generator
+
+urls = ( "/", "generator"
+ , '/generator.html', 'generator'
+ , '/generated.html', 'generated' )
+
+render = web.template.render('templates/')
+
+class generator:
+ def GET(self, name=None):
+ form = forms.generator_t(action='/generated.html')
+ return render.generator(form)
+
+class generated:
+ def POST(self, r_url=None ):
+ form = forms.generator_t( action='', code_generator=code_generator.manager_t() )
+ generated, warnings = form.process( web.input() )
+ return render.generated(generated, warnings)
+
+if __name__ == '__main__':
+ app = web.application(urls, globals(), autoreload=True)
+ app.run()
Added: ui/web/static/favicon.ico
===================================================================
(Binary files differ)
Property changes on: ui/web/static/favicon.ico
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: ui/web/templates/generated.html
===================================================================
--- ui/web/templates/generated.html (rev 0)
+++ ui/web/templates/generated.html 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,35 @@
+$def with (code, warnings)
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="shortcut icon" href="/static/favicon.ico" />
+ <link rel="icon" href="/static/favicon.ico" />
+ <title>pygccxml & py++ demo - generated code</title>
+</head>
+<body>
+ <h2>pygccxml & py++ demo - generated code</h2>
+ <span style="width:80%; float:left;">
+ <label>Generated code:</label>
+ <br/>
+ <textarea name="generated_code" rows="20" readonly="true" style="width:100%;">$:code</textarea>
+ </span>
+ <a> </a>
+ <span style="float : left; padding-left : 10px; width : 18%;">
+ <br/>
+ <label style="width:100%;">What is ... ?</label>
+ <dt>
+ <dd><a href="http://www.language-binding.net">py++</a></dd>
+ <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
+ </dt>
+ <label style="width:100%;">Adsense placeholder</label>
+ <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
+ </span>
+ <span style="width:100%;">
+ <br/>
+ <label>Warnings:</label>
+ <br/>
+ <textarea name="warnings" rows="15" readonly="true" style="width:100%;">$:warnings</textarea>
+ </span>
+</body>
+</html>
Added: ui/web/templates/generated_tmpl.html
===================================================================
--- ui/web/templates/generated_tmpl.html (rev 0)
+++ ui/web/templates/generated_tmpl.html 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="shortcut icon" href="/static/favicon.ico" />
+ <link rel="icon" href="/static/favicon.ico" />
+ <title>pygccxml & py++ demo - generated code</title>
+</head>
+<body>
+ <h2>pygccxml & py++ demo - generated code</h2>
+ <span style="width:80%; float:left;">
+ <label>Generated code</label>
+ <br/>
+ <textarea name="generated_code" rows="20" readonly="true" style="width:100%;">hihi</textarea>
+ </span>
+ <a> </a>
+ <span style="float : left; padding-left : 10px; width : 18%;">
+ <br/>
+ <label style="width:100;">What is ... ?</label>
+ <dt>
+ <dd><a href="http://www.language-binding.net">py++</a></dd>
+ <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
+ </dt>
+ <label style="width:100;">Adsense placeholder</label>
+ <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
+ </span>
+</body>
+</html>
Added: ui/web/templates/generator.html
===================================================================
--- ui/web/templates/generator.html (rev 0)
+++ ui/web/templates/generator.html 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,25 @@
+$def with (generator_form)
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="shortcut icon" href="/static/favicon.ico" />
+ <link rel="icon" href="/static/favicon.ico" />
+ <title>pygccxml & py++ demo</title>
+</head>
+<body>
+ <h2>pygccxml & py++ demo</h2>
+ $:generator_form.render()
+ <a> </a>
+ <span style="float : left; padding-left : 10px; width : 18%;">
+ <br/>
+ <label style="width:100;">What is ... ?</label>
+ <dt>
+ <dd><a href="http://www.language-binding.net">py++</a></dd>
+ <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
+ </dt>
+ <label style="width:100;">Adsense placeholder</label>
+ <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
+ </span>
+</body>
+</html>
Added: ui/web/templates/generator_tmpl.html
===================================================================
--- ui/web/templates/generator_tmpl.html (rev 0)
+++ ui/web/templates/generator_tmpl.html 2008-10-22 21:55:39 UTC (rev 1445)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="shortcut icon" href="/static/favicon.ico" />
+ <link rel="icon" href="/static/favicon.ico" />
+ <title>pygccxml & py++ demo</title>
+</head>
+<body>
+ <h2>pygccxml & py++ demo</h2>
+ <form action="/generated.html" method="post" id="SourceCodeForm" style="width:80%; float:left;">
+ <label>Source code:</label>
+ <br/>
+ <textarea name="source_code" rows="20" style="width:100%;"></textarea>
+ <br/>
+ <input type="submit" name="show_decls" value="Show declarations" />
+ <a></a>
+ <input type="submit" name="generate_bp" value="Generate Boost.Python code" />
+ <a></a>
+ <input type="submit" name="generate_pypp" value="Generate Py++ code" />
+ </form>
+ <a> </a>
+ <span style="float : left; padding-left : 10px; width : 18%;">
+ <br/>
+ <label style="width:100;">What is ... ?</label>
+ <dt>
+ <dd><a href="http://www.language-binding.net">py++</a></dd>
+ <dd><a href="http://www.language-binding.net">pygccxml</a></dd>
+ </dt>
+ <label style="width:100;">Adsense placeholder</label>
+ <textarea name="adsense" rows="15" style="width:100;">jjjjjjjjjjjjjjjjjjjjjjjjjj</textarea>
+ </span>
+</body>
+</html>
Added: ui/web/web.zip
===================================================================
(Binary files differ)
Property changes on: ui/web/web.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-21 20:29:49
|
Revision: 1443
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1443&view=rev
Author: roman_yakovenko
Date: 2008-10-21 20:29:42 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
add internal_type_traits class
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/__init__.py
pygccxml_dev/pygccxml/declarations/type_traits.py
Modified: pygccxml_dev/pygccxml/declarations/__init__.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/__init__.py 2008-10-21 09:25:41 UTC (rev 1442)
+++ pygccxml_dev/pygccxml/declarations/__init__.py 2008-10-21 20:29:42 UTC (rev 1443)
@@ -174,6 +174,7 @@
from type_traits import auto_ptr_traits
from type_traits import smart_pointer_traits
+from type_traits import internal_type_traits
from container_traits import list_traits
from container_traits import deque_traits
Modified: pygccxml_dev/pygccxml/declarations/type_traits.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/type_traits.py 2008-10-21 09:25:41 UTC (rev 1442)
+++ pygccxml_dev/pygccxml/declarations/type_traits.py 2008-10-21 20:29:42 UTC (rev 1443)
@@ -974,6 +974,28 @@
else:
return None
+class internal_type_traits:
+ """small convenience class, which provides access to internal types"""
+ #TODO: add exists function
+ @staticmethod
+ def get_by_name( type, name ):
+ if class_traits.is_my_case( type ):
+ cls = class_traits.declaration_class( type )
+ return remove_declarated( cls.typedef( name, recursive=False ).type )
+ elif class_declaration_traits.is_my_case( type ):
+ cls = class_declaration_traits.get_declaration( type )
+ value_type_str = templates.args( cls.name )[0]
+ ref = impl_details.find_value_type( cls.top_parent, value_type_str )
+ if ref:
+ return ref
+ else:
+ raise RuntimeError( "Unable to find reference to internal type '%s' in type '%s'."
+ % ( name, cls.decl_string ) )
+ else:
+ raise RuntimeError( "Unable to find reference to internal type '%s' in type '%s'."
+ % ( name, type.decl_string ) )
+
+
class smart_pointer_traits:
"""implements functionality, needed for convinient work with smart pointers"""
@@ -994,19 +1016,7 @@
"""returns reference to boost::shared_ptr value type"""
if not smart_pointer_traits.is_smart_pointer( type ):
raise TypeError( 'Type "%s" is not instantiation of boost::shared_ptr' % type.decl_string )
- type = remove_alias( type )
- cls = remove_cv( type )
- cls = remove_declarated( type )
- if isinstance( cls, class_declaration.class_t ):
- return remove_declarated( cls.typedef( "value_type", recursive=False ).type )
- elif not isinstance( cls, ( class_declaration.class_declaration_t, class_declaration.class_t ) ):
- raise RuntimeError( "Unable to find out shared_ptr value type. shared_ptr class is: %s" % cls.decl_string )
- else:
- value_type_str = templates.args( cls.name )[0]
- ref = impl_details.find_value_type( cls.top_parent, value_type_str )
- if None is ref:
- raise RuntimeError( "Unable to find out shared_ptr value type. shared_ptr class is: %s" % cls.decl_string )
- return ref
+ return internal_type_traits.get_by_name( type, "value_type" )
class auto_ptr_traits:
"""implements functionality, needed for convinient work with std::auto_ptr pointers"""
@@ -1028,19 +1038,7 @@
"""returns reference to boost::shared_ptr value type"""
if not auto_ptr_traits.is_smart_pointer( type ):
raise TypeError( 'Type "%s" is not instantiation of std::auto_ptr' % type.decl_string )
- type = remove_alias( type )
- cls = remove_cv( type )
- cls = remove_declarated( type )
- if isinstance( cls, class_declaration.class_t ):
- return remove_declarated( cls.typedef( "element_type", recursive=False ).type )
- elif not isinstance( cls, ( class_declaration.class_declaration_t, class_declaration.class_t ) ):
- raise RuntimeError( "Unable to find out auto_ptr value type. auto_ptr class is: %s" % cls.decl_string )
- else:
- value_type_str = templates.args( cls.name )[0]
- ref = impl_details.find_value_type( cls.top_parent, value_type_str )
- if None is ref:
- raise RuntimeError( "Unable to find out auto_ptr value type. shared_ptr class is: %s" % cls.decl_string )
- return ref
+ return internal_type_traits.get_by_name( type, "element_type" )
def is_std_string( type ):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-21 10:22:35
|
Revision: 1442
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1442&view=rev
Author: roman_yakovenko
Date: 2008-10-21 09:25:41 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
adding "verbose" mode for decl_printer
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/decl_printer.py
Modified: pygccxml_dev/pygccxml/declarations/decl_printer.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/decl_printer.py 2008-10-20 12:18:17 UTC (rev 1441)
+++ pygccxml_dev/pygccxml/declarations/decl_printer.py 2008-10-21 09:25:41 UTC (rev 1442)
@@ -26,12 +26,13 @@
JUSTIFY = 20
INDENT_SIZE = 4
- def __init__( self, level=0, print_details=True, recursive=True, writer=None ):
+ def __init__( self, level=0, print_details=True, recursive=True, writer=None, verbose=True ):
decl_visitor.decl_visitor_t.__init__(self)
self.__inst = None
self.__level = level
self.__print_details = print_details
self.__recursive = recursive
+ self.__verbose = verbose
self.__writer = writer
if not self.__writer:
self.__writer = lambda x: sys.stdout.write( x + os.linesep )
@@ -43,6 +44,7 @@
return decl_printer_t( level
, self.print_details
, recursive=self.recursive
+ , verbose=self.__verbose
, writer=self.writer )
def _get_recursive(self):
@@ -51,6 +53,12 @@
self.__recursive = recursive
recursive = property( _get_recursive, _set_recursive)
+ def _get_verbose(self):
+ return self.__verbose
+ def _set_verbose(self, verbose):
+ self.__verbose = verbose
+ verbose = property( _get_verbose, _set_verbose)
+
def _get_level(self):
return self.__level
def _set_level(self, lvl):
@@ -75,6 +83,16 @@
self.__inst = inst
instance = property( _get_inst, _set_inst )
+ def is_builtin_decl( self, decl ):
+ if not decl.name.startswith( '__builtin_' ):
+ return False
+ if decl.location \
+ and decl.location.file_name \
+ and decl.location.file_name.endswith('gccxml_builtins.h'):
+ return True
+ else:
+ return False
+
def __nice_decl_name( self, inst ):
name = inst.__class__.__name__
return name
@@ -90,20 +108,19 @@
if self.__inst.location:
location = 'location: [%s]:%s'%(self.__inst.location.file_name, self.__inst.location.line)
self.writer( ' ' * curr_level * self.INDENT_SIZE + location)
- artificial = 'artificial: ' + "'%s'" % str(self.__inst.is_artificial)
- self.writer( ' ' * curr_level * self.INDENT_SIZE + artificial.ljust( self.JUSTIFY ))
- if self.__inst.attributes:
+ if self.verbose:
+ artificial = 'artificial: ' + "'%s'" % str(self.__inst.is_artificial)
+ self.writer( ' ' * curr_level * self.INDENT_SIZE + artificial.ljust( self.JUSTIFY ))
+ if self.verbose and self.__inst.attributes:
attributes = 'attributes: %s'%(self.__inst.attributes)
self.writer( ' ' * curr_level * self.INDENT_SIZE + attributes)
- if self.__inst.demangled:
+ if self.verbose and self.__inst.demangled:
demangled = 'demangled: %s'%(self.__inst.demangled)
self.writer( ' ' * curr_level * self.INDENT_SIZE + demangled)
- if self.__inst.mangled:
+ if self.verbose and self.__inst.mangled:
mangled = 'mangled: %s'%(self.__inst.mangled)
self.writer( ' ' * curr_level * self.INDENT_SIZE + mangled)
-
-
def print_calldef_info(self, decl=None):
""" Returns function signature: [retval, [arg1, ..., argN]]. """
if None is decl:
@@ -192,11 +209,11 @@
def print_members(members_type, members, curr_level):
self.writer( ' ' * curr_level * self.INDENT_SIZE + members_type.ljust( self.JUSTIFY ))
if self.__recursive:
- curr_level += 1
- for member in members:
- prn = self.clone()
- prn.instance = member
- algorithm.apply_visitor( prn, member )
+ curr_level += 1
+ for member in members:
+ prn = self.clone()
+ prn.instance = member
+ algorithm.apply_visitor( prn, member )
if self.__inst.bases:
print_hierarchy( 'base classes: ', self.__inst.bases, curr_level )
@@ -218,12 +235,16 @@
self.writer( value_level + "%s : %s"% (name, value))
def visit_namespace(self ):
+ if self.verbose == False and not self.__inst.declarations:
+ return #don't print info about empty namespaces
self.print_decl_header()
if self.__recursive:
- for decl in self.__inst.declarations:
- prn = self.clone()
- prn.instance = decl
- algorithm.apply_visitor( prn, decl )
+ for decl in self.__inst.declarations:
+ if self.is_builtin_decl( decl ):
+ continue
+ prn = self.clone()
+ prn.instance = decl
+ algorithm.apply_visitor( prn, decl )
def visit_typedef(self ):
self.print_decl_header()
@@ -233,7 +254,7 @@
def visit_variable(self ):
self.print_decl_header()
curr_level = self.level + 1
- self.writer( ' ' * curr_level * self.INDENT_SIZE + 'type: %s value: %s'%(self.__inst.type.decl_string, self.__inst.value) + os.linesep)
+ self.writer( ' ' * curr_level * self.INDENT_SIZE + 'type: %s value: %s'%(self.__inst.type.decl_string, self.__inst.value) )
if self.__print_details:
byte_size = 'size: %d'%(self.__inst.type.byte_size)
self.writer( ' ' * curr_level * self.INDENT_SIZE + byte_size.ljust( self.JUSTIFY ))
@@ -245,14 +266,18 @@
byte_offset = 'offset: %d'%(self.__inst.byte_offset)
self.writer( ' ' * curr_level * self.INDENT_SIZE + byte_offset + os.linesep)
-def print_declarations( decls, detailed=True, recursive=True, writer=lambda x: sys.stdout.write( x + os.linesep ) ):
+def print_declarations( decls
+ , detailed=True
+ , recursive=True
+ , writer=lambda x: sys.stdout.write( x + os.linesep )
+ , verbose=True):
""" Print decl tree rooted at each of the included nodes.
decls - either a single decl or a list of decls.
"""
- prn = decl_printer_t(0, detailed, recursive, writer)
+ prn = decl_printer_t(0, detailed, recursive, writer, verbose=verbose)
if type(decls) is not list:
- decls = [decls]
+ decls = [decls]
for d in decls:
- prn.level = 0
- prn.instance = d
- algorithm.apply_visitor(prn, d)
+ prn.level = 0
+ prn.instance = d
+ algorithm.apply_visitor(prn, d)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-20 13:22:19
|
Revision: 1441
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1441&view=rev
Author: roman_yakovenko
Date: 2008-10-20 12:18:17 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
Modified Paths:
--------------
website/site_creator/environment.py
Modified: website/site_creator/environment.py
===================================================================
--- website/site_creator/environment.py 2008-10-20 08:20:21 UTC (rev 1440)
+++ website/site_creator/environment.py 2008-10-20 12:18:17 UTC (rev 1441)
@@ -21,8 +21,8 @@
production_dir = os.path.join( os.path.split( sources_root )[0], 'production' )
production_www_dir = os.path.join( production_dir, 'www')
configuration_file = 'www_configuration'
- templates_dir = os.path.join( development_dir, 'templates', 'offline' )
- #templates_dir = os.path.join( development_dir, 'templates', 'online' )
+ #templates_dir = os.path.join( development_dir, 'templates', 'offline' )
+ templates_dir = os.path.join( development_dir, 'templates', 'online' )
site_css = 'language_binding.css'
home_url = 'http://www.language-binding.net'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-20 10:22:10
|
Revision: 1440
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1440&view=rev
Author: roman_yakovenko
Date: 2008-10-20 08:20:21 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
updating tags
Added Paths:
-----------
tags/pygccxml_dev_1.0.0/
Removed Paths:
-------------
pygccxml_dev_1.0.0/
Property changes on: tags/pygccxml_dev_1.0.0
___________________________________________________________________
Added: svn:ignore
+ build
dist
MANIFEST
Added: svn:mergeinfo
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-20 08:23:11
|
Revision: 1439
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1439&view=rev
Author: roman_yakovenko
Date: 2008-10-20 08:18:51 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
Added Paths:
-----------
tags/pyplusplus_dev_1.0.0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-20 08:18:33
|
Revision: 1438
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1438&view=rev
Author: roman_yakovenko
Date: 2008-10-20 08:14:12 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
Added Paths:
-----------
pygccxml_dev_1.0.0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-20 06:49:09
|
Revision: 1437
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1437&view=rev
Author: roman_yakovenko
Date: 2008-10-20 06:49:00 +0000 (Mon, 20 Oct 2008)
Log Message:
-----------
adding missing packages
Modified Paths:
--------------
pygccxml_dev/setup.py
Modified: pygccxml_dev/setup.py
===================================================================
--- pygccxml_dev/setup.py 2008-10-18 08:52:18 UTC (rev 1436)
+++ pygccxml_dev/setup.py 2008-10-20 06:49:00 UTC (rev 1437)
@@ -60,6 +60,9 @@
packages = [ 'pygccxml',
'pygccxml.declarations',
'pygccxml.parser',
+ 'pygccxml.msvc',
+ 'pygccxml.msvc.bsc',
+ 'pygccxml.msvc.pdb',
'pygccxml.utils' ],
cmdclass = {"doc" : doc_cmd}
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-18 08:56:39
|
Revision: 1436
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1436&view=rev
Author: roman_yakovenko
Date: 2008-10-18 08:52:18 +0000 (Sat, 18 Oct 2008)
Log Message:
-----------
add compiler argument to module builder
Modified Paths:
--------------
pyplusplus_dev/pyplusplus/module_builder/builder.py
Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py
===================================================================
--- pyplusplus_dev/pyplusplus/module_builder/builder.py 2008-10-14 18:32:18 UTC (rev 1435)
+++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2008-10-18 08:52:18 UTC (rev 1436)
@@ -40,7 +40,8 @@
, ignore_gccxml_output=False
, indexing_suite_version=1
, cflags=""
- , encoding='ascii'):
+ , encoding='ascii'
+ , compiler=None):
"""
@param files: list of files, declarations from them you want to export
@type files: list of strings or L{file_configuration_t} instances
@@ -72,7 +73,8 @@
, undefine_symbols=undefine_symbols
, start_with_declarations=start_with_declarations
, ignore_gccxml_output=ignore_gccxml_output
- , cflags=cflags)
+ , cflags=cflags
+ , compiler=compiler)
#may be in future I will add those directories to user_defined_directories
#to self.__code_creator.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-14 18:32:29
|
Revision: 1435
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1435&view=rev
Author: roman_yakovenko
Date: 2008-10-14 18:32:18 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
small spelling error fix
Modified Paths:
--------------
pygccxml_dev/announcement.txt
Modified: pygccxml_dev/announcement.txt
===================================================================
--- pygccxml_dev/announcement.txt 2008-10-12 19:41:04 UTC (rev 1434)
+++ pygccxml_dev/announcement.txt 2008-10-14 18:32:18 UTC (rev 1435)
@@ -28,7 +28,7 @@
* Support for ellipsis was added.
-* New expiremental back-end, based on ``.pdb`` (progam database file), was added.
+* New experimental back-end, based on ``.pdb`` (progam database file), was added.
* New high-level API wrapper for ``.bsc`` (browse source code file) was added.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-12 19:41:11
|
Revision: 1434
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1434&view=rev
Author: roman_yakovenko
Date: 2008-10-12 19:41:04 +0000 (Sun, 12 Oct 2008)
Log Message:
-----------
fix broken links
Modified Paths:
--------------
pyplusplus_dev/docs/documentation/ctypes/unions.rest
pyplusplus_dev/docs/documentation/how_to/best_practices.rest
pyplusplus_dev/docs/history/history.rest
Modified: pyplusplus_dev/docs/documentation/ctypes/unions.rest
===================================================================
--- pyplusplus_dev/docs/documentation/ctypes/unions.rest 2008-10-12 19:12:57 UTC (rev 1433)
+++ pyplusplus_dev/docs/documentation/ctypes/unions.rest 2008-10-12 19:41:04 UTC (rev 1434)
@@ -47,7 +47,7 @@
.. code-block:: Python
import ctypes
- from <your module> import data_t
+ from <<<your module>>> import data_t
#lets define our union
class actual_data_t( ctypes.Union ):
Modified: pyplusplus_dev/docs/documentation/how_to/best_practices.rest
===================================================================
--- pyplusplus_dev/docs/documentation/how_to/best_practices.rest 2008-10-12 19:12:57 UTC (rev 1433)
+++ pyplusplus_dev/docs/documentation/how_to/best_practices.rest 2008-10-12 19:41:04 UTC (rev 1434)
@@ -169,7 +169,7 @@
the whole project.
-.. _`Py++` : ./../pyplusplus.html
+.. _`Py++` : ./../../pyplusplus.html
.. _`pygccxml` : ./../../../pygccxml/pygccxml.html
.. _`Boost.Python`: http://www.boost.org/libs/python/doc/index.html
.. _`Python`: http://www.python.org
Modified: pyplusplus_dev/docs/history/history.rest
===================================================================
--- pyplusplus_dev/docs/history/history.rest 2008-10-12 19:12:57 UTC (rev 1433)
+++ pyplusplus_dev/docs/history/history.rest 2008-10-12 19:41:04 UTC (rev 1434)
@@ -302,7 +302,7 @@
5. Support for opaque types was added. Read more about this feature `here`__.
-.. __ : ../documentation/functions/call_policies.html#special-case
+.. __ : ../documentation/functions/call_policies/call_policies.html#special-case
6. It is possible to configure "Py++" to generate faster ( compilation time )
code for indexing suite version 2. See API documentation.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rom...@us...> - 2008-10-12 19:13:03
|
Revision: 1433
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1433&view=rev
Author: roman_yakovenko
Date: 2008-10-12 19:12:57 +0000 (Sun, 12 Oct 2008)
Log Message:
-----------
add sitemap cfg file
Added Paths:
-----------
website/site_creator/sitemap_config_linux.xml
Added: website/site_creator/sitemap_config_linux.xml
===================================================================
--- website/site_creator/sitemap_config_linux.xml (rev 0)
+++ website/site_creator/sitemap_config_linux.xml 2008-10-12 19:12:57 UTC (rev 1433)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site
+ base_url="http://www.language-binding.net/"
+ store_into="sitemap.xml.gz"
+ verbose="1">
+
+ <directory
+ path="/home/roman/language-binding/production/www"
+ url="http://www.language-binding.net/"
+ default_file="index.html" />
+
+</site>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|