summaryrefslogtreecommitdiffstats
path: root/Tools/modulator/Templates
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-21 22:36:19 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-03-21 22:36:19 (GMT)
commit2614cda20910e1b2529d5af4a95327f8cdfcc35a (patch)
tree4a2d95569150aa2b6f81eb8ea921eac67afa2bf8 /Tools/modulator/Templates
parentb5023a1433c4afbf2460a6433593769d1d99bee5 (diff)
downloadcpython-2614cda20910e1b2529d5af4a95327f8cdfcc35a.zip
cpython-2614cda20910e1b2529d5af4a95327f8cdfcc35a.tar.gz
cpython-2614cda20910e1b2529d5af4a95327f8cdfcc35a.tar.bz2
Merged revisions 78338,78345-78346,78561-78562,78566,78574,78581,78634,78660,78675 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78338 | andrew.kuchling | 2010-02-22 15:04:02 -0600 (Mon, 22 Feb 2010) | 4 lines Remove Tools/modulator, a reference to it in the docs, and a screenshot of it. (I asked the BDFL first, and he approved removing it. The last actual bugfix to Tools/modulator was in 2001; since then all changes have been search-and-replace: string methods, whitespace fixes, etc.) ........ r78345 | andrew.kuchling | 2010-02-22 17:10:52 -0600 (Mon, 22 Feb 2010) | 1 line #7706: DONT_HAVE_ERRNO_H is no longer defined by configure (after rev.46819). ........ r78346 | andrew.kuchling | 2010-02-22 17:12:00 -0600 (Mon, 22 Feb 2010) | 1 line #7706: add include guards where they're missing; required for Windows CE ........ r78561 | andrew.kuchling | 2010-03-01 13:51:43 -0600 (Mon, 01 Mar 2010) | 1 line #7191: describe more details of wbits parameter ........ r78562 | andrew.kuchling | 2010-03-01 14:11:57 -0600 (Mon, 01 Mar 2010) | 1 line #7637: avoid repeated-concatenation antipattern in example ........ r78566 | barry.warsaw | 2010-03-01 15:46:51 -0600 (Mon, 01 Mar 2010) | 4 lines Manually copy patch for bug 7250 from the release26-maint branch. I suck because I did this in the wrong order and couldn't smack svnmerge into submission. ........ r78574 | benjamin.peterson | 2010-03-01 17:25:13 -0600 (Mon, 01 Mar 2010) | 1 line remove CVS id ........ r78581 | michael.foord | 2010-03-02 08:22:15 -0600 (Tue, 02 Mar 2010) | 1 line Link correction in documentation. ........ r78634 | benjamin.peterson | 2010-03-03 15:28:25 -0600 (Wed, 03 Mar 2010) | 1 line rephrase ........ r78660 | dirkjan.ochtman | 2010-03-04 13:21:53 -0600 (Thu, 04 Mar 2010) | 4 lines Try to fix buildbot breakage from r78384. Thanks bitdancer and briancurtin for the help. ........ r78675 | florent.xicluna | 2010-03-04 19:12:14 -0600 (Thu, 04 Mar 2010) | 2 lines These line should not be there. ........
Diffstat (limited to 'Tools/modulator/Templates')
-rw-r--r--Tools/modulator/Templates/copyright0
-rw-r--r--Tools/modulator/Templates/module_head6
-rw-r--r--Tools/modulator/Templates/module_method14
-rw-r--r--Tools/modulator/Templates/module_tail37
-rw-r--r--Tools/modulator/Templates/object_head13
-rw-r--r--Tools/modulator/Templates/object_method14
-rw-r--r--Tools/modulator/Templates/object_mlist8
-rw-r--r--Tools/modulator/Templates/object_new13
-rw-r--r--Tools/modulator/Templates/object_structure37
-rw-r--r--Tools/modulator/Templates/object_tail33
-rw-r--r--Tools/modulator/Templates/object_tp_as_mapping29
-rw-r--r--Tools/modulator/Templates/object_tp_as_number162
-rw-r--r--Tools/modulator/Templates/object_tp_as_sequence58
-rw-r--r--Tools/modulator/Templates/object_tp_call7
-rw-r--r--Tools/modulator/Templates/object_tp_compare6
-rw-r--r--Tools/modulator/Templates/object_tp_dealloc7
-rw-r--r--Tools/modulator/Templates/object_tp_getattr7
-rw-r--r--Tools/modulator/Templates/object_tp_hash6
-rw-r--r--Tools/modulator/Templates/object_tp_print7
-rw-r--r--Tools/modulator/Templates/object_tp_repr9
-rw-r--r--Tools/modulator/Templates/object_tp_setattr9
-rw-r--r--Tools/modulator/Templates/object_tp_str10
22 files changed, 0 insertions, 492 deletions
diff --git a/Tools/modulator/Templates/copyright b/Tools/modulator/Templates/copyright
deleted file mode 100644
index e69de29..0000000
--- a/Tools/modulator/Templates/copyright
+++ /dev/null
diff --git a/Tools/modulator/Templates/module_head b/Tools/modulator/Templates/module_head
deleted file mode 100644
index be00109..0000000
--- a/Tools/modulator/Templates/module_head
+++ /dev/null
@@ -1,6 +0,0 @@
-
-#include "Python.h"
-
-static PyObject *ErrorObject;
-
-/* ----------------------------------------------------- */
diff --git a/Tools/modulator/Templates/module_method b/Tools/modulator/Templates/module_method
deleted file mode 100644
index 3048b1f..0000000
--- a/Tools/modulator/Templates/module_method
+++ /dev/null
@@ -1,14 +0,0 @@
-
-static char $abbrev$_$method$__doc__[] =
-""
-;
-
-static PyObject *
-$abbrev$_$method$(PyObject *self /* Not used */, PyObject *args)
-{
-
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
diff --git a/Tools/modulator/Templates/module_tail b/Tools/modulator/Templates/module_tail
deleted file mode 100644
index 59cc50b..0000000
--- a/Tools/modulator/Templates/module_tail
+++ /dev/null
@@ -1,37 +0,0 @@
-
-/* List of methods defined in the module */
-
-static struct PyMethodDef $abbrev$_methods[] = {
- $methodlist$
- {NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */
-};
-
-
-/* Initialization function for the module (*must* be called init$name$) */
-
-static char $name$_module_documentation[] =
-""
-;
-
-void
-init$name$()
-{
- PyObject *m, *d;
-
- /* Create the module and add the functions */
- m = Py_InitModule4("$name$", $abbrev$_methods,
- $name$_module_documentation,
- (PyObject*)NULL,PYTHON_API_VERSION);
-
- /* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
- ErrorObject = PyString_FromString("$name$.error");
- PyDict_SetItemString(d, "error", ErrorObject);
-
- /* XXXX Add constants here */
-
- /* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module $name$");
-}
-
diff --git a/Tools/modulator/Templates/object_head b/Tools/modulator/Templates/object_head
deleted file mode 100644
index 07d1f6a..0000000
--- a/Tools/modulator/Templates/object_head
+++ /dev/null
@@ -1,13 +0,0 @@
-
-/* Declarations for objects of type $name$ */
-
-typedef struct {
- PyObject_HEAD
- /* XXXX Add your own stuff here */
-} $abbrev$object;
-
-static PyTypeObject $Abbrev$type;
-
-
-
-/* ---------------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_method b/Tools/modulator/Templates/object_method
deleted file mode 100644
index b15162c..0000000
--- a/Tools/modulator/Templates/object_method
+++ /dev/null
@@ -1,14 +0,0 @@
-
-static char $abbrev$_$method$__doc__[] =
-""
-;
-
-static PyObject *
-$abbrev$_$method$($abbrev$object *self, PyObject *args)
-{
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
- Py_INCREF(Py_None);
- return Py_None;
-}
-
diff --git a/Tools/modulator/Templates/object_mlist b/Tools/modulator/Templates/object_mlist
deleted file mode 100644
index a12a9e1..0000000
--- a/Tools/modulator/Templates/object_mlist
+++ /dev/null
@@ -1,8 +0,0 @@
-
-static struct PyMethodDef $abbrev$_methods[] = {
- $methodlist$
- {NULL, NULL} /* sentinel */
-};
-
-/* ---------- */
-
diff --git a/Tools/modulator/Templates/object_new b/Tools/modulator/Templates/object_new
deleted file mode 100644
index 30c5e36..0000000
--- a/Tools/modulator/Templates/object_new
+++ /dev/null
@@ -1,13 +0,0 @@
-
-static $abbrev$object *
-new$abbrev$object()
-{
- $abbrev$object *self;
-
- self = PyObject_NEW($abbrev$object, &$Abbrev$type);
- if (self == NULL)
- return NULL;
- /* XXXX Add your own initializers here */
- return self;
-}
-
diff --git a/Tools/modulator/Templates/object_structure b/Tools/modulator/Templates/object_structure
deleted file mode 100644
index 78daa62..0000000
--- a/Tools/modulator/Templates/object_structure
+++ /dev/null
@@ -1,37 +0,0 @@
-
-/* Code to access structure members by accessing attributes */
-
-#include "structmember.h"
-
-#define OFF(x) offsetof(XXXXobject, x)
-
-static PyMemberDef $abbrev$_memberlist[] = {
- /* XXXX Add lines like { "foo", T_INT, OFF(foo), READONLY } */
-
- {NULL} /* Sentinel */
-};
-
-static PyObject *
-$abbrev$_getattr($abbrev$object *self, char *name)
-{
- PyObject *rv;
-
- /* XXXX Add your own getattr code here */
- rv = PyMember_GetOne((char *)/*XXXX*/0, &$abbrev$_memberlist[i]);
- if (rv)
- return rv;
- PyErr_Clear();
- return Py_FindMethod($abbrev$_methods, (PyObject *)self, name);
-}
-
-
-static int
-$abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
-{
- /* XXXX Add your own setattr code here */
- if ( v == NULL ) {
- PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute");
- return -1;
- }
- return PyMember_SetOne((char *)/*XXXX*/0, &$abbrev$_memberlist[i], v);
-}
diff --git a/Tools/modulator/Templates/object_tail b/Tools/modulator/Templates/object_tail
deleted file mode 100644
index 1d1334c..0000000
--- a/Tools/modulator/Templates/object_tail
+++ /dev/null
@@ -1,33 +0,0 @@
-
-static char $Abbrev$type__doc__[] =
-""
-;
-
-static PyTypeObject $Abbrev$type = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /*ob_size*/
- "$name$", /*tp_name*/
- sizeof($abbrev$object), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)$tp_dealloc$, /*tp_dealloc*/
- (printfunc)$tp_print$, /*tp_print*/
- (getattrfunc)$tp_getattr$, /*tp_getattr*/
- (setattrfunc)$tp_setattr$, /*tp_setattr*/
- (cmpfunc)$tp_compare$, /*tp_compare*/
- (reprfunc)$tp_repr$, /*tp_repr*/
- $tp_as_number$, /*tp_as_number*/
- $tp_as_sequence$, /*tp_as_sequence*/
- $tp_as_mapping$, /*tp_as_mapping*/
- (hashfunc)$tp_hash$, /*tp_hash*/
- (ternaryfunc)$tp_call$, /*tp_call*/
- (reprfunc)$tp_str$, /*tp_str*/
-
- /* Space for future expansion */
- 0L,0L,0L,0L,
- $Abbrev$type__doc__ /* Documentation string */
-};
-
-/* End of code for $name$ objects */
-/* -------------------------------------------------------- */
-
diff --git a/Tools/modulator/Templates/object_tp_as_mapping b/Tools/modulator/Templates/object_tp_as_mapping
deleted file mode 100644
index f9213b7..0000000
--- a/Tools/modulator/Templates/object_tp_as_mapping
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/* Code to access $name$ objects as mappings */
-
-static int
-$abbrev$_length($abbrev$object *self)
-{
- /* XXXX Return the size of the mapping */
-}
-
-static PyObject *
-$abbrev$_subscript($abbrev$object *self, PyObject *key)
-{
- /* XXXX Return the item of self indexed by key */
-}
-
-static int
-$abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
-{
- /* XXXX Put w in self under key v */
- return 0;
-}
-
-static PyMappingMethods $abbrev$_as_mapping = {
- (inquiry)$abbrev$_length, /*mp_length*/
- (binaryfunc)$abbrev$_subscript, /*mp_subscript*/
- (objobjargproc)$abbrev$_ass_sub, /*mp_ass_subscript*/
-};
-
-/* -------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_tp_as_number b/Tools/modulator/Templates/object_tp_as_number
deleted file mode 100644
index a3426c2..0000000
--- a/Tools/modulator/Templates/object_tp_as_number
+++ /dev/null
@@ -1,162 +0,0 @@
-
-/* Code to access $name$ objects as numbers */
-
-static PyObject *
-$abbrev$_add($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Add them */
-}
-
-static PyObject *
-$abbrev$_sub($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Subtract them */
-}
-
-static PyObject *
-$abbrev$_mul($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Multiply them */
-}
-
-static PyObject *
-$abbrev$_div($abbrev$object *x, $abbrev$object *y)
-{
- /* XXXX Divide them */
-}
-
-static PyObject *
-$abbrev$_mod($abbrev$object *x, $abbrev$object *y)
-{
- /* XXXX Modulo them */
-}
-
-static PyObject *
-$abbrev$_divmod($abbrev$object *x, $abbrev$object *y)
-{
- /* XXXX Return 2-tuple with div and mod */
-}
-
-static PyObject *
-$abbrev$_pow($abbrev$object *v, $abbrev$object *w, $abbrev$object *z)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_neg($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_pos($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_abs($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static int
-$abbrev$_nonzero($abbrev$object *v)
-{
- /* XXXX Return 1 if non-zero */
-}
-
-static PyObject *
-$abbrev$_invert($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_lshift($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_rshift($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_and($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_xor($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_or($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_int($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_long($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_float($abbrev$object *v)
-{
- /* XXXX */
-}
-
-static PyObject *
-$abbrev$_oct($abbrev$object *v)
-{
- /* XXXX Return object as octal stringobject */
-}
-
-static PyObject *
-$abbrev$_hex($abbrev$object *v)
-{
- /* XXXX Return object as hex stringobject */
-}
-
-static PyNumberMethods $abbrev$_as_number = {
- (binaryfunc)$abbrev$_add, /*nb_add*/
- (binaryfunc)$abbrev$_sub, /*nb_subtract*/
- (binaryfunc)$abbrev$_mul, /*nb_multiply*/
- (binaryfunc)$abbrev$_div, /*nb_divide*/
- (binaryfunc)$abbrev$_mod, /*nb_remainder*/
- (binaryfunc)$abbrev$_divmod, /*nb_divmod*/
- (ternaryfunc)$abbrev$_pow, /*nb_power*/
- (unaryfunc)$abbrev$_neg, /*nb_negative*/
- (unaryfunc)$abbrev$_pos, /*nb_positive*/
- (unaryfunc)$abbrev$_abs, /*nb_absolute*/
- (inquiry)$abbrev$_nonzero, /*nb_nonzero*/
- (unaryfunc)$abbrev$_invert, /*nb_invert*/
- (binaryfunc)$abbrev$_lshift, /*nb_lshift*/
- (binaryfunc)$abbrev$_rshift, /*nb_rshift*/
- (binaryfunc)$abbrev$_and, /*nb_and*/
- (binaryfunc)$abbrev$_xor, /*nb_xor*/
- (binaryfunc)$abbrev$_or, /*nb_or*/
- (coercion)$abbrev$_coerce, /*nb_coerce*/
- (unaryfunc)$abbrev$_int, /*nb_int*/
- (unaryfunc)$abbrev$_long, /*nb_long*/
- (unaryfunc)$abbrev$_float, /*nb_float*/
- (unaryfunc)$abbrev$_oct, /*nb_oct*/
- (unaryfunc)$abbrev$_hex, /*nb_hex*/
-};
-
-/* ------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_tp_as_sequence b/Tools/modulator/Templates/object_tp_as_sequence
deleted file mode 100644
index 54c0b92..0000000
--- a/Tools/modulator/Templates/object_tp_as_sequence
+++ /dev/null
@@ -1,58 +0,0 @@
-
-/* Code to handle accessing $name$ objects as sequence objects */
-
-static int
-$abbrev$_length($abbrev$object *self)
-{
- /* XXXX Return the size of the object */
-}
-
-static PyObject *
-$abbrev$_concat($abbrev$object *self, PyObject *bb)
-{
- /* XXXX Return the concatenation of self and bb */
-}
-
-static PyObject *
-$abbrev$_repeat($abbrev$object *self, int n)
-{
- /* XXXX Return a new object that is n times self */
-}
-
-static PyObject *
-$abbrev$_item($abbrev$object *self, int i)
-{
- /* XXXX Return the i-th object of self */
-}
-
-static PyObject *
-$abbrev$_slice($abbrev$object *self, int ilow, int ihigh)
-{
- /* XXXX Return the ilow..ihigh slice of self in a new object */
-}
-
-static int
-$abbrev$_ass_item($abbrev$object *self, int i, PyObject *v)
-{
- /* XXXX Assign to the i-th element of self */
- return 0;
-}
-
-static int
-$abbrev$_ass_slice(PyListObject *self, int ilow, int ihigh, PyObject *v)
-{
- /* XXXX Replace ilow..ihigh slice of self with v */
- return 0;
-}
-
-static PySequenceMethods $abbrev$_as_sequence = {
- (inquiry)$abbrev$_length, /*sq_length*/
- (binaryfunc)$abbrev$_concat, /*sq_concat*/
- (intargfunc)$abbrev$_repeat, /*sq_repeat*/
- (intargfunc)$abbrev$_item, /*sq_item*/
- (intintargfunc)$abbrev$_slice, /*sq_slice*/
- (intobjargproc)$abbrev$_ass_item, /*sq_ass_item*/
- (intintobjargproc)$abbrev$_ass_slice, /*sq_ass_slice*/
-};
-
-/* -------------------------------------------------------------- */
diff --git a/Tools/modulator/Templates/object_tp_call b/Tools/modulator/Templates/object_tp_call
deleted file mode 100644
index a93f17f..0000000
--- a/Tools/modulator/Templates/object_tp_call
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static PyObject *
-$abbrev$_call($abbrev$object *self, PyObject *args, PyObject *kwargs)
-{
- /* XXXX Return the result of calling self with argument args */
-}
-
diff --git a/Tools/modulator/Templates/object_tp_compare b/Tools/modulator/Templates/object_tp_compare
deleted file mode 100644
index 153bae0..0000000
--- a/Tools/modulator/Templates/object_tp_compare
+++ /dev/null
@@ -1,6 +0,0 @@
-
-static int
-$abbrev$_compare($abbrev$object *v, $abbrev$object *w)
-{
- /* XXXX Compare objects and return -1, 0 or 1 */
-}
diff --git a/Tools/modulator/Templates/object_tp_dealloc b/Tools/modulator/Templates/object_tp_dealloc
deleted file mode 100644
index 440419a..0000000
--- a/Tools/modulator/Templates/object_tp_dealloc
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static void
-$abbrev$_dealloc($abbrev$object *self)
-{
- /* XXXX Add your own cleanup code here */
- PyMem_DEL(self);
-}
diff --git a/Tools/modulator/Templates/object_tp_getattr b/Tools/modulator/Templates/object_tp_getattr
deleted file mode 100644
index 6a1b2e8..0000000
--- a/Tools/modulator/Templates/object_tp_getattr
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static PyObject *
-$abbrev$_getattr($abbrev$object *self, char *name)
-{
- /* XXXX Add your own getattr code here */
- return Py_FindMethod($abbrev$_methods, (PyObject *)self, name);
-}
diff --git a/Tools/modulator/Templates/object_tp_hash b/Tools/modulator/Templates/object_tp_hash
deleted file mode 100644
index 2d63f6a..0000000
--- a/Tools/modulator/Templates/object_tp_hash
+++ /dev/null
@@ -1,6 +0,0 @@
-
-static long
-$abbrev$_hash($abbrev$object *self)
-{
- /* XXXX Return a hash of self (or -1) */
-}
diff --git a/Tools/modulator/Templates/object_tp_print b/Tools/modulator/Templates/object_tp_print
deleted file mode 100644
index 76408d2..0000000
--- a/Tools/modulator/Templates/object_tp_print
+++ /dev/null
@@ -1,7 +0,0 @@
-
-static int
-$abbrev$_print($abbrev$object *self, FILE *fp, int flags)
-{
- /* XXXX Add code here to print self to fp */
- return 0;
-}
diff --git a/Tools/modulator/Templates/object_tp_repr b/Tools/modulator/Templates/object_tp_repr
deleted file mode 100644
index f122225..0000000
--- a/Tools/modulator/Templates/object_tp_repr
+++ /dev/null
@@ -1,9 +0,0 @@
-
-static PyObject *
-$abbrev$_repr($abbrev$object *self)
-{
- PyObject *s;
-
- /* XXXX Add code here to put self into s */
- return s;
-}
diff --git a/Tools/modulator/Templates/object_tp_setattr b/Tools/modulator/Templates/object_tp_setattr
deleted file mode 100644
index dfe4bc8..0000000
--- a/Tools/modulator/Templates/object_tp_setattr
+++ /dev/null
@@ -1,9 +0,0 @@
-
-static int
-$abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
-{
- /* Set attribute 'name' to value 'v'. v==NULL means delete */
-
- /* XXXX Add your own setattr code here */
- return -1;
-}
diff --git a/Tools/modulator/Templates/object_tp_str b/Tools/modulator/Templates/object_tp_str
deleted file mode 100644
index 2e3648e..0000000
--- a/Tools/modulator/Templates/object_tp_str
+++ /dev/null
@@ -1,10 +0,0 @@
-
-static PyObject *
-$abbrev$_str($abbrev$object *self)
-{
- PyObject *s;
-
- /* XXXX Add code here to put self into s */
- return s;
-}
-