Python 2.2, avaiable at
+To run Pyste, you will need:
+
-Installation for the tools is avaiable in their respective webpages.
+Installation for the tools is available in their respective webpages.
GCCXML must be accessible in the PATH environment variable, so
-that pyste can call it. How to do this varies from platform to platform.
+that Pyste can call it. How to do this varies from platform to platform.
|
@@ -62,7 +62,7 @@ where options are:
--no-using do not declare "using namespace boost";
use explicit declarations instead
--pyste-ns=<name> set the namespace where new types will be declared;
- default is "pyste"
+ default is the empty namespace
--debug writes the xml for each file parsed in the current
directory
-h, --help print this help and exit
@@ -71,11 +71,12 @@ where options are:
Options explained:
-The -I and -D are preprocessor flags, which are needed by gccxml to parse
-the header files correctly and by pyste to find the header files declared in the
+The -I and -D are preprocessor flags, which are needed by
+GCCXML to parse
+the header files correctly and by Pyste to find the header files declared in the
interface files.
---multiple tells pyste to generate multiple cpps for this module (one for
+--multiple tells Pyste to generate multiple cpps for this module (one for
each header parsed) in the directory named by --out, instead of the usual
single cpp file. This mode is useful during development of a binding, because
you are constantly changing source files, re-generating the bindings and
@@ -84,7 +85,7 @@ recompiling. This saves a lot of time in compiling.
--out names the output file (default: <module>.cpp), or in multiple mode,
names a output directory for the files (default: <module>).
---no-using tells pyste to don't declare "using namespace boost;" in the
+--no-using tells Pyste to don't declare "using namespace boost;" in the
generated cpp, using the namespace boost::python explicitly in all declarations.
Use only if you're having a name conflict in one of the files.
@@ -92,7 +93,8 @@ Use --pyste-ns to change the namespace where new types are declared (fo
instance, the virtual wrappers). Use only if you are having any problems. By
default, Pyste uses the empty namespace.
---debug will write in the current directory a xml file as outputted by gccxml
+--debug will write in the current directory a xml file as outputted by
+GCCXML
for each header parsed. Useful for bug reports.
-h, --help, -v, --version are self-explaining, I believe. ;)
diff --git a/pyste/doc/smart_pointers.html b/pyste/doc/smart_pointers.html
index 902709fe..e63b49ff 100644
--- a/pyste/doc/smart_pointers.html
+++ b/pyste/doc/smart_pointers.html
@@ -45,7 +45,7 @@ Pyste for now has manual support for smart pointers. Suppose:
To make newC and printC work correctly, you have to tell Pyste that a
-conversor for boost::shared_ptr<C> is needed.
+convertor for boost::shared_ptr<C> is needed.
C = Class('C', 'C.h')
use_shared_ptr(C)
@@ -55,7 +55,7 @@ conversor for boost::shared_ptr<C> is needed.
For std::auto_ptr's, use the function use_auto_ptr.
-This system is temporary, and in the future the conversors will automatically be
+This system is temporary, and in the future the converters will automatically be
exported if needed, without the need to tell Pyste about them explicitly.
diff --git a/pyste/doc/templates.html b/pyste/doc/templates.html
index 58548c72..81dfa1e9 100644
--- a/pyste/doc/templates.html
+++ b/pyste/doc/templates.html
@@ -25,7 +25,7 @@
-Template Classes can easily exported too, but you can't export the "Template"
+Template classes can easily be exported too, but you can't export the template
itself... you have to export instantiations of it! So, if you want to export a
std::vector, you will have to export vectors of int, doubles, etc.
@@ -55,7 +55,7 @@ rename the instantiations:
rename(double_inst, "DPoint")
-Note that you can rename, exclude, set policies, etc, in the Template class
+Note that you can rename, exclude, set policies, etc, in the Template object
like you would do with a Function or a Class. This changes affect all
future instantiations:
@@ -80,7 +80,7 @@ If you want to change a option of a particular instantiation, you can do so:
What if my template accepts more than one type?
-When you want to instantiate a Template with more than one type, you can pass
+When you want to instantiate a template with more than one type, you can pass
either a string with the types separated by whitespace, or a list of strings
("int double" or ["int", "double"] would both work).
|
diff --git a/pyste/doc/the_interface_files.html b/pyste/doc/the_interface_files.html
index 77246af7..0e78e4ec 100644
--- a/pyste/doc/the_interface_files.html
+++ b/pyste/doc/the_interface_files.html
@@ -27,7 +27,7 @@
The interface files are the heart of Pyste. The user creates one or more
interface files declaring the classes and functions he wants to export, and then
-invokes pyste passing the interface files to it. Pyste then generates a single
+invokes Pyste passing the interface files to it. Pyste then generates a single
cpp file with
Boost.Python code, with all the classes and functions exported.
diff --git a/pyste/doc/wrappers.html b/pyste/doc/wrappers.html
index 66ce4413..63c9a9ce 100644
--- a/pyste/doc/wrappers.html
+++ b/pyste/doc/wrappers.html
@@ -30,9 +30,9 @@ Suppose you have this function:
std::vector<std::string> names();
-But you don't want to export std::vector<string>, you want this function
+But you don't want to export std::vector<std::string>, you want this function
to return a python list of strings.
-Boost.Python has an excellent support for
+Boost.Python has excellent support for
that:
list names_wrapper()
@@ -40,7 +40,11 @@ that:
list result;
// call original function
vector<string> v = names();
- // put each string from the vector in the list
+ // put all the strings inside the python list
+ vector<string>::iterator it;
+ for (it = v.begin(); it != v.end(); ++it){
+ result.append(*it);
+ }
return result;
}
@@ -64,14 +68,14 @@ You can optionally declare the function in the interface file itself:
"""
list names_wrapper()
{
- // call name() and convert the vector to a list...
+ // code to call name() and convert the vector to a list...
}
""")
names = Function("names", "test.h")
set_wrapper(names, names_wrapper)
-The same mechanism can be done with methods too. Just remember that the first
+The same mechanism can be used with methods too. Just remember that the first
parameter of wrappers for methods is a pointer to the class, like in
Boost.Python:
diff --git a/pyste/example/.cvsignore b/pyste/example/.cvsignore
index 38b475ff..7ee0168b 100644
--- a/pyste/example/.cvsignore
+++ b/pyste/example/.cvsignore
@@ -1,2 +1,2 @@
-*.cpp
.sconsign
+*.obj
diff --git a/pyste/example/basic.cpp b/pyste/example/basic.cpp
new file mode 100644
index 00000000..9e6ed996
--- /dev/null
+++ b/pyste/example/basic.cpp
@@ -0,0 +1,8 @@
+#include "basic.h"
+
+namespace basic {
+
+ int C::static_value = 3;
+ const int C::const_static_value = 100;
+
+}
diff --git a/pyste/example/basic.h b/pyste/example/basic.h
index 92ff55bc..16469e95 100644
--- a/pyste/example/basic.h
+++ b/pyste/example/basic.h
@@ -1,3 +1,7 @@
+#ifndef BASIC_H
+#define BASIC_H
+
+
#include
namespace basic {
@@ -24,27 +28,26 @@ struct C
const int const_value;
};
-int C::static_value = 3;
-const int C::const_static_value = 100;
-
-int call_f(C& c)
+inline int call_f(C& c)
{
return c.f();
}
-int call_f(C& c, int x)
+inline int call_f(C& c, int x)
{
return c.f(x);
}
-int get_static()
+inline int get_static()
{
return C::static_value;
}
-int get_value(C& c)
+inline int get_value(C& c)
{
return c.value;
}
}
+
+#endif
diff --git a/pyste/example/enums.h b/pyste/example/enums.h
index 398b66c0..207001e0 100644
--- a/pyste/example/enums.h
+++ b/pyste/example/enums.h
@@ -1,3 +1,6 @@
+#ifndef ENUMS_H
+#define ENUMS_H
+
namespace enums {
enum color { red, blue };
@@ -17,3 +20,5 @@ struct X
};
}
+
+#endif
diff --git a/pyste/example/header_test.h b/pyste/example/header_test.h
index 85cb5ee0..286f5449 100644
--- a/pyste/example/header_test.h
+++ b/pyste/example/header_test.h
@@ -1,3 +1,6 @@
+#ifndef HEADER_TEST_H
+#define HEADER_TEST_H
+
#include