summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-01-28 17:15:33 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-01-28 17:34:32 -0300
commita664eaa9fe791d5102f6089767e83acf3d5a5eba (patch)
tree001a6a1432f6947252edf37f3e2aa99f18fa37ba
parent4133c98e691455c2abaa11bf4439e858e9afaf40 (diff)
downloadshiboken-a664eaa9fe791d5102f6089767e83acf3d5a5eba.tar.gz
shiboken-a664eaa9fe791d5102f6089767e83acf3d5a5eba.tar.xz
shiboken-a664eaa9fe791d5102f6089767e83acf3d5a5eba.zip
Type system %TYPE variable is now available for class wide custom code.
%TYPE documentation was updated.
-rw-r--r--doc/typesystemvariables.rst4
-rw-r--r--generator/shibokengenerator.cpp1
2 files changed, 3 insertions, 2 deletions
diff --git a/doc/typesystemvariables.rst b/doc/typesystemvariables.rst
index 1a6a36f9..9f31bce4 100644
--- a/doc/typesystemvariables.rst
+++ b/doc/typesystemvariables.rst
@@ -250,8 +250,8 @@ Variables
**%TYPE**
- Replaced by the name of the class to which a function belongs. Should be used
- in code injected to methods.
+ Replaced by the name of the class to which a function belongs. May be used
+ in code injected at method or class level.
.. _example:
diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp
index 06e52677..72f396d0 100644
--- a/generator/shibokengenerator.cpp
+++ b/generator/shibokengenerator.cpp
@@ -1144,6 +1144,7 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s,
// replace template variable for the Python Type object for the
// class context in which the variable is used
code.replace("%PYTHONTYPEOBJECT", cpythonTypeName(context) + ".super.ht_type");
+ code.replace("%TYPE", wrapperName(context));
}
// replace "toPython "converters