Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-17 Thread Martijn Brouwer
On 16 Jan 2003 11:47:20 -0200
Johan Dahlin [EMAIL PROTECTED] wrote:

   Strange.
   I seems that the code generator was interrupted when generating atk.c
   Try to remove atk.c (it's generated) and the build/ directory (it's used
   by distutils)
   
   If it still doesn't work, could you send me a more detailed bug report
   with gcc version, python version and the broken atk.c.
  
  I removed the atk.c file, the build dir, did cvs update, but rebuilding gave the 
same results.
  gcc 2.95.4, on debian sarge. python 2.2. I have attached atk.c.
 
 Looking on the output of atk.c it looks like the error is in the
 following part of the code, codegen/codegen.py line 665
 
 # This is working well
 bymod = {}
 for module, pyname, cname in imports:
 bymod.setdefault(module, []).append((pyname, cname))
 fp.write('PyObject *module;\n\n')
 
 # Here it stops
 for module in bymod:
 fp.write('if ((module = PyImport_ImportModule()
 fp.write(' PyObject *moddict = PyModul)
 
 
 It might be due to a bogus import statement of some kind.
 
 Could you try to add a debug output and print out bmod just before that.
 And modify setup.py to print out the argument send to the codegenerator?
 (add a print s on line 225 in setup.py)

Strange things are happening. When I add some print statements to codegen.py, they are 
not printed to the screen but into atk.c!
The value of bymod printed there is: {'gobject': [('GObject', 'PyGObject_Type')]}
I have included both atk.c and codegen.py in a attachment.

Bye and Thanks,

Martijn



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-16 Thread Johan Dahlin
  Strange.
  I seems that the code generator was interrupted when generating atk.c
  Try to remove atk.c (it's generated) and the build/ directory (it's used
  by distutils)
  
  If it still doesn't work, could you send me a more detailed bug report
  with gcc version, python version and the broken atk.c.
 
 I removed the atk.c file, the build dir, did cvs update, but rebuilding gave the 
same results.
 gcc 2.95.4, on debian sarge. python 2.2. I have attached atk.c.

Looking on the output of atk.c it looks like the error is in the
following part of the code, codegen/codegen.py line 665

# This is working well
bymod = {}
for module, pyname, cname in imports:
bymod.setdefault(module, []).append((pyname, cname))
fp.write('PyObject *module;\n\n')

# Here it stops
for module in bymod:
fp.write('if ((module = PyImport_ImportModule()
fp.write(' PyObject *moddict = PyModul)


It might be due to a bogus import statement of some kind.

Could you try to add a debug output and print out bmod just before that.
And modify setup.py to print out the argument send to the codegenerator?
(add a print s on line 225 in setup.py)

Thanks
-- 
Johan Dahlin [EMAIL PROTECTED]
Async Open Source

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-16 Thread Martijn Brouwer
On 16 Jan 2003 11:47:20 -0200
Johan Dahlin [EMAIL PROTECTED] wrote:
 Looking on the output of atk.c it looks like the error is in the
 following part of the code, codegen/codegen.py line 665
 
 # This is working well
 bymod = {}
 for module, pyname, cname in imports:
 bymod.setdefault(module, []).append((pyname, cname))
 fp.write('PyObject *module;\n\n')
 
 # Here it stops
 for module in bymod:
 fp.write('if ((module = PyImport_ImportModule()
 fp.write(' PyObject *moddict = PyModul)
 
 
 It might be due to a bogus import statement of some kind.
 
 Could you try to add a debug output and print out bmod just before that.
 And modify setup.py to print out the argument send to the codegenerator?
 (add a print s on line 225 in setup.py)

The codegenerator is not run:
The function self.check_dates() from Template.generate() returns 1 so 
Template.generate() returns without running codegen.py.
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-16 Thread Johan Dahlin

  It might be due to a bogus import statement of some kind.
  
  Could you try to add a debug output and print out bmod just before that.
  And modify setup.py to print out the argument send to the codegenerator?
  (add a print s on line 225 in setup.py)
 
 The codegenerator is not run:
 The function self.check_dates() from Template.generate() returns 1 so 
Template.generate() returns without running codegen.py.

You must remove atk.c to make the codegenerator run again (or touch
atk.defs)

-- 
Johan Dahlin [EMAIL PROTECTED]
Async Open Source

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-16 Thread Martijn Brouwer
On 16 Jan 2003 20:47:34 -0200
Johan Dahlin [EMAIL PROTECTED] wrote:

 
   It might be due to a bogus import statement of some kind.
   
   Could you try to add a debug output and print out bmod just before that.
   And modify setup.py to print out the argument send to the codegenerator?
   (add a print s on line 225 in setup.py)
  
  The codegenerator is not run:
  The function self.check_dates() from Template.generate() returns 1 so 
Template.generate() returns without running codegen.py.
 
 You must remove atk.c to make the codegenerator run again (or touch
 atk.defs)

Here the codegen command string. The rest I will do tomorrow, my bed and my wife are 
waiting ;-)

python codegen/codegen.py  --register atk-types.defs  --override atk.override  
--prefix pyatk atk.defs   atk.c 

Bye,

Martijn

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] [cvs] compilation of atk.c fails

2003-01-13 Thread Martijn Brouwer
When I compile pygtk using distuitls (./setup.py install --prefix=/home/martijn/sys/) 
compilation of atk.c fails with:

building 'atk' extension
skipping atkmodule.c (build/temp.linux-i686-2.2/atkmodule.o up-to-date)
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DVERSION=1.99.14 
-DPYGTK_MAJOR_VERSION=1 -DPYGTK_MINOR_VERSION=99 -DPYGTK_MICRO_VERSION=14 
-I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -Igtk 
-I/usr/include/python2.2 -c atk.c -o build/temp.linux-i686-2.2/atk.o
atk.c: In function `pyatk_register_classes':
atk.c:1569: parse error at end of input
error: command 'gcc' failed with exit status 1

Am I doing something wrong or is this an error in the repository?

Bye,

Martijn

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-13 Thread Johan Dahlin
mån 2003-01-13 klockan 16.53 skrev Martijn Brouwer:
 When I compile pygtk using distuitls (./setup.py install 
--prefix=/home/martijn/sys/) compilation of atk.c fails with:
 
 building 'atk' extension
 skipping atkmodule.c (build/temp.linux-i686-2.2/atkmodule.o up-to-date)
 gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DVERSION=1.99.14 
-DPYGTK_MAJOR_VERSION=1 -DPYGTK_MINOR_VERSION=99 -DPYGTK_MICRO_VERSION=14 
-I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -Igtk 
-I/usr/include/python2.2 -c atk.c -o build/temp.linux-i686-2.2/atk.o
 atk.c: In function `pyatk_register_classes':
 atk.c:1569: parse error at end of input
 error: command 'gcc' failed with exit status 1

Strange.
I seems that the code generator was interrupted when generating atk.c
Try to remove atk.c (it's generated) and the build/ directory (it's used
by distutils)

If it still doesn't work, could you send me a more detailed bug report
with gcc version, python version and the broken atk.c.

-- 
Johan Dahlin [EMAIL PROTECTED]
Async Open Source

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-13 Thread Martijn Brouwer
On 13 Jan 2003 17:03:24 -0200
Johan Dahlin [EMAIL PROTECTED] wrote:

 mån 2003-01-13 klockan 16.53 skrev Martijn Brouwer:
  When I compile pygtk using distuitls (./setup.py install 
--prefix=/home/martijn/sys/) compilation of atk.c fails with:
  
  building 'atk' extension
  skipping atkmodule.c (build/temp.linux-i686-2.2/atkmodule.o up-to-date)
  gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DVERSION=1.99.14 
-DPYGTK_MAJOR_VERSION=1 -DPYGTK_MINOR_VERSION=99 -DPYGTK_MICRO_VERSION=14 
-I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -Igtk 
-I/usr/include/python2.2 -c atk.c -o build/temp.linux-i686-2.2/atk.o
  atk.c: In function `pyatk_register_classes':
  atk.c:1569: parse error at end of input
  error: command 'gcc' failed with exit status 1
 
 Strange.
 I seems that the code generator was interrupted when generating atk.c
 Try to remove atk.c (it's generated) and the build/ directory (it's used
 by distutils)
 
 If it still doesn't work, could you send me a more detailed bug report
 with gcc version, python version and the broken atk.c.

I removed the atk.c file, the build dir, did cvs update, but rebuilding gave the same 
results.
gcc 2.95.4, on debian sarge. python 2.2. I have attached atk.c.

Thanks for the quick reply

Martijn
/* -*- Mode: C; c-basic-offset: 4 -*- */

#include Python.h



#line 4 atk.override
#include Python.h

#include pygobject.h
#include atk/atk.h
#include atk/atknoopobjectfactory.h
#include atk/atknoopobject.h
#line 15 atk.c


/* -- types from other modules -- */
static PyTypeObject *_PyGObject_Type;
#define PyGObject_Type (*_PyGObject_Type)


/* -- forward type declarations -- */
PyTypeObject PyAtkHyperlink_Type;
PyTypeObject PyAtkObject_Type;
PyTypeObject PyAtkNoOpObject_Type;
PyTypeObject PyAtkObjectFactory_Type;
PyTypeObject PyAtkNoOpObjectFactory_Type;
PyTypeObject PyAtkRegistry_Type;
PyTypeObject PyAtkRelation_Type;
PyTypeObject PyAtkRelationSet_Type;
PyTypeObject PyAtkStateSet_Type;
PyTypeObject PyAtkUtil_Type;


/* --- AtkHyperlink --- */

static int
pygobject_no_constructor(PyObject *self, PyObject *args, PyObject *kwargs)
{
gchar buf[512];

g_snprintf(buf, sizeof(buf), %s is an abstract widget, self-ob_type-tp_name);
PyErr_SetString(PyExc_NotImplementedError, buf);
return -1;
}

static PyObject *
_wrap_atk_hyperlink_get_uri(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { i, NULL };
gchar *ret;
int i;

if (!PyArg_ParseTupleAndKeywords(args, kwargs, i:AtkHyperlink.get_uri, kwlist, i))
return NULL;
ret = atk_hyperlink_get_uri(ATK_HYPERLINK(self-obj), i);
if (ret) {
PyObject *py_ret = PyString_FromString(ret);
g_free(ret);
return py_ret;
}
Py_INCREF(Py_None);
return Py_None;
}

static PyObject *
_wrap_atk_hyperlink_get_object(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { i, NULL };
AtkObject *ret;
int i;

if (!PyArg_ParseTupleAndKeywords(args, kwargs, i:AtkHyperlink.get_object, kwlist, i))
return NULL;
ret = atk_hyperlink_get_object(ATK_HYPERLINK(self-obj), i);
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}

static PyObject *
_wrap_atk_hyperlink_get_end_index(PyGObject *self)
{
int ret;

ret = atk_hyperlink_get_end_index(ATK_HYPERLINK(self-obj));
return PyInt_FromLong(ret);
}

static PyObject *
_wrap_atk_hyperlink_get_start_index(PyGObject *self)
{
int ret;

ret = atk_hyperlink_get_start_index(ATK_HYPERLINK(self-obj));
return PyInt_FromLong(ret);
}

static PyObject *
_wrap_atk_hyperlink_is_valid(PyGObject *self)
{
PyObject *py_ret;
int ret;

ret = atk_hyperlink_is_valid(ATK_HYPERLINK(self-obj));
py_ret = ret ? Py_True : Py_False;
Py_INCREF(py_ret);
return py_ret;
}

static PyObject *
_wrap_atk_hyperlink_get_n_anchors(PyGObject *self)
{
int ret;

ret = atk_hyperlink_get_n_anchors(ATK_HYPERLINK(self-obj));
return PyInt_FromLong(ret);
}

static PyMethodDef _PyAtkHyperlink_methods[] = {
{ get_uri, (PyCFunction)_wrap_atk_hyperlink_get_uri, METH_VARARGS|METH_KEYWORDS },
{ get_object, (PyCFunction)_wrap_atk_hyperlink_get_object, METH_VARARGS|METH_KEYWORDS },
{ get_end_index, (PyCFunction)_wrap_atk_hyperlink_get_end_index, METH_NOARGS },
{ get_start_index, (PyCFunction)_wrap_atk_hyperlink_get_start_index, METH_NOARGS },
{ is_valid, (PyCFunction)_wrap_atk_hyperlink_is_valid, METH_NOARGS },
{ get_n_anchors, (PyCFunction)_wrap_atk_hyperlink_get_n_anchors, METH_NOARGS },
{ NULL, NULL, 0 }
};

PyTypeObject PyAtkHyperlink_Type = {
PyObject_HEAD_INIT(NULL)
0,	/* ob_size */
atk.Hyperlink,			/* tp_name */
sizeof(PyGObject),	/* tp_basicsize */
0,	/* tp_itemsize */
/* methods */
(destructor)0,			/* tp_dealloc */
(printfunc)0,			/* tp_print */

Re: [pygtk] [cvs] compilation of atk.c fails

2003-01-13 Thread Martijn Brouwer
On 13 Jan 2003 17:03:24 -0200
Johan Dahlin [EMAIL PROTECTED] wrote:

 mån 2003-01-13 klockan 16.53 skrev Martijn Brouwer:
  When I compile pygtk using distuitls (./setup.py install 
--prefix=/home/martijn/sys/) compilation of atk.c fails with:
  
  building 'atk' extension
  skipping atkmodule.c (build/temp.linux-i686-2.2/atkmodule.o up-to-date)
  gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DVERSION=1.99.14 
-DPYGTK_MAJOR_VERSION=1 -DPYGTK_MINOR_VERSION=99 -DPYGTK_MICRO_VERSION=14 
-I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I. -Igtk 
-I/usr/include/python2.2 -c atk.c -o build/temp.linux-i686-2.2/atk.o
  atk.c: In function `pyatk_register_classes':
  atk.c:1569: parse error at end of input
  error: command 'gcc' failed with exit status 1
 
 Strange.
 I seems that the code generator was interrupted when generating atk.c
 Try to remove atk.c (it's generated) and the build/ directory (it's used
 by distutils)
 
 If it still doesn't work, could you send me a more detailed bug report
 with gcc version, python version and the broken atk.c.

I remeved the atk.c file, the build dir, did cvs update, but rebuilding gave the same 
results.
gcc 2.95.4, on debian sarge. python 2.2. I have attached atk.c.

Thanks for the quick reply

/* -*- Mode: C; c-basic-offset: 4 -*- */

#include Python.h



#line 4 atk.override
#include Python.h

#include pygobject.h
#include atk/atk.h
#include atk/atknoopobjectfactory.h
#include atk/atknoopobject.h
#line 15 atk.c


/* -- types from other modules -- */
static PyTypeObject *_PyGObject_Type;
#define PyGObject_Type (*_PyGObject_Type)


/* -- forward type declarations -- */
PyTypeObject PyAtkHyperlink_Type;
PyTypeObject PyAtkObject_Type;
PyTypeObject PyAtkNoOpObject_Type;
PyTypeObject PyAtkObjectFactory_Type;
PyTypeObject PyAtkNoOpObjectFactory_Type;
PyTypeObject PyAtkRegistry_Type;
PyTypeObject PyAtkRelation_Type;
PyTypeObject PyAtkRelationSet_Type;
PyTypeObject PyAtkStateSet_Type;
PyTypeObject PyAtkUtil_Type;


/* --- AtkHyperlink --- */

static int
pygobject_no_constructor(PyObject *self, PyObject *args, PyObject *kwargs)
{
gchar buf[512];

g_snprintf(buf, sizeof(buf), %s is an abstract widget, self-ob_type-tp_name);
PyErr_SetString(PyExc_NotImplementedError, buf);
return -1;
}

static PyObject *
_wrap_atk_hyperlink_get_uri(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { i, NULL };
gchar *ret;
int i;

if (!PyArg_ParseTupleAndKeywords(args, kwargs, i:AtkHyperlink.get_uri, kwlist, i))
return NULL;
ret = atk_hyperlink_get_uri(ATK_HYPERLINK(self-obj), i);
if (ret) {
PyObject *py_ret = PyString_FromString(ret);
g_free(ret);
return py_ret;
}
Py_INCREF(Py_None);
return Py_None;
}

static PyObject *
_wrap_atk_hyperlink_get_object(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { i, NULL };
AtkObject *ret;
int i;

if (!PyArg_ParseTupleAndKeywords(args, kwargs, i:AtkHyperlink.get_object, kwlist, i))
return NULL;
ret = atk_hyperlink_get_object(ATK_HYPERLINK(self-obj), i);
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}

static PyObject *
_wrap_atk_hyperlink_get_end_index(PyGObject *self)
{
int ret;

ret = atk_hyperlink_get_end_index(ATK_HYPERLINK(self-obj));
return PyInt_FromLong(ret);
}

static PyObject *
_wrap_atk_hyperlink_get_start_index(PyGObject *self)
{
int ret;

ret = atk_hyperlink_get_start_index(ATK_HYPERLINK(self-obj));
return PyInt_FromLong(ret);
}

static PyObject *
_wrap_atk_hyperlink_is_valid(PyGObject *self)
{
PyObject *py_ret;
int ret;

ret = atk_hyperlink_is_valid(ATK_HYPERLINK(self-obj));
py_ret = ret ? Py_True : Py_False;
Py_INCREF(py_ret);
return py_ret;
}

static PyObject *
_wrap_atk_hyperlink_get_n_anchors(PyGObject *self)
{
int ret;

ret = atk_hyperlink_get_n_anchors(ATK_HYPERLINK(self-obj));
return PyInt_FromLong(ret);
}

static PyMethodDef _PyAtkHyperlink_methods[] = {
{ get_uri, (PyCFunction)_wrap_atk_hyperlink_get_uri, METH_VARARGS|METH_KEYWORDS },
{ get_object, (PyCFunction)_wrap_atk_hyperlink_get_object, METH_VARARGS|METH_KEYWORDS },
{ get_end_index, (PyCFunction)_wrap_atk_hyperlink_get_end_index, METH_NOARGS },
{ get_start_index, (PyCFunction)_wrap_atk_hyperlink_get_start_index, METH_NOARGS },
{ is_valid, (PyCFunction)_wrap_atk_hyperlink_is_valid, METH_NOARGS },
{ get_n_anchors, (PyCFunction)_wrap_atk_hyperlink_get_n_anchors, METH_NOARGS },
{ NULL, NULL, 0 }
};

PyTypeObject PyAtkHyperlink_Type = {
PyObject_HEAD_INIT(NULL)
0,	/* ob_size */
atk.Hyperlink,			/* tp_name */
sizeof(PyGObject),	/* tp_basicsize */
0,	/* tp_itemsize */
/* methods */
(destructor)0,			/* tp_dealloc */
(printfunc)0,			/* tp_print */
(getattrfunc)0,	/*