Changeset 16656

Show
Ignore:
Timestamp:
06/19/08 00:04:51 (4 months ago)
Author:
piotras
Message:

Fixed methods allocation for Mgdschema classes.
MgdSchema? classes initialized with NULL static_bases ( whatever it means ).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/apis/python/py_midgard_object.c

    r16655 r16656  
    455455static PyMethodDef *__midgard_object_methods_pmd() 
    456456{ 
    457         PyMethodDef *pmd = g_new0(PyMethodDef, 25); 
     457        PyMethodDef *pmd = g_new(PyMethodDef, 26); 
    458458         
    459459        pmd[0].ml_name = "get_by_id"; 
     
    537537        pmd[15].ml_doc = NULL; 
    538538 
    539         pmd[15].ml_name = "delete_parameters"; 
    540         pmd[15].ml_meth = (PyCFunction)pymidgard_object_delete_parameters; 
    541         pmd[15].ml_flags = METH_VARARGS; 
    542         pmd[15].ml_doc = NULL; 
    543  
    544         pmd[16].ml_name = "purge_parameters"; 
    545         pmd[16].ml_meth = (PyCFunction)pymidgard_object_purge_parameters; 
     539        pmd[16].ml_name = "delete_parameters"; 
     540        pmd[16].ml_meth = (PyCFunction)pymidgard_object_delete_parameters; 
    546541        pmd[16].ml_flags = METH_VARARGS; 
    547542        pmd[16].ml_doc = NULL; 
    548543 
    549         pmd[17].ml_name = "list_parameters"; 
    550         pmd[17].ml_meth = (PyCFunction)pymidgard_object_list_parameters; 
     544        pmd[17].ml_name = "purge_parameters"; 
     545        pmd[17].ml_meth = (PyCFunction)pymidgard_object_purge_parameters; 
    551546        pmd[17].ml_flags = METH_VARARGS; 
    552547        pmd[17].ml_doc = NULL; 
    553548 
    554         pmd[18].ml_name = "find_parameters"; 
    555         pmd[18].ml_meth = (PyCFunction)pymidgard_object_find_parameters; 
     549        pmd[18].ml_name = "list_parameters"; 
     550        pmd[18].ml_meth = (PyCFunction)pymidgard_object_list_parameters; 
    556551        pmd[18].ml_flags = METH_VARARGS; 
    557552        pmd[18].ml_doc = NULL; 
    558553 
    559         pmd[19].ml_name = "delete_attachments"; 
    560         pmd[19].ml_meth = (PyCFunction)pymidgard_object_delete_attachments; 
     554        pmd[19].ml_name = "find_parameters"; 
     555        pmd[19].ml_meth = (PyCFunction)pymidgard_object_find_parameters; 
    561556        pmd[19].ml_flags = METH_VARARGS; 
    562557        pmd[19].ml_doc = NULL; 
    563558 
    564         pmd[20].ml_name = "purge_attachments"; 
    565         pmd[20].ml_meth = (PyCFunction)pymidgard_object_purge_attachments; 
     559        pmd[20].ml_name = "delete_attachments"; 
     560        pmd[20].ml_meth = (PyCFunction)pymidgard_object_delete_attachments; 
    566561        pmd[20].ml_flags = METH_VARARGS; 
    567562        pmd[20].ml_doc = NULL; 
    568563 
    569         pmd[21].ml_name = "list_attachments"; 
    570         pmd[21].ml_meth = (PyCFunction)pymidgard_object_list_attachments; 
     564        pmd[21].ml_name = "purge_attachments"; 
     565        pmd[21].ml_meth = (PyCFunction)pymidgard_object_purge_attachments; 
    571566        pmd[21].ml_flags = METH_VARARGS; 
    572567        pmd[21].ml_doc = NULL; 
    573568 
    574         pmd[22].ml_name = "find_attachments"; 
    575         pmd[22].ml_meth = (PyCFunction)pymidgard_object_find_attachments; 
     569        pmd[22].ml_name = "list_attachments"; 
     570        pmd[22].ml_meth = (PyCFunction)pymidgard_object_list_attachments; 
    576571        pmd[22].ml_flags = METH_VARARGS; 
    577572        pmd[22].ml_doc = NULL; 
    578573 
    579         pmd[23].ml_name = "create_attachment"; 
    580         pmd[23].ml_meth = (PyCFunction)pymidgard_object_create_attachment
     574        pmd[23].ml_name = "find_attachments"; 
     575        pmd[23].ml_meth = (PyCFunction)pymidgard_object_find_attachments
    581576        pmd[23].ml_flags = METH_VARARGS; 
    582577        pmd[23].ml_doc = NULL; 
    583578 
    584         pmd[24].ml_name = NULL
    585         pmd[24].ml_meth = NULL
    586         pmd[24].ml_flags = 0
     579        pmd[24].ml_name = "create_attachment"
     580        pmd[24].ml_meth = (PyCFunction)pymidgard_object_create_attachment
     581        pmd[24].ml_flags = METH_VARARGS
    587582        pmd[24].ml_doc = NULL; 
    588583 
     584        pmd[25].ml_name = NULL; 
     585        pmd[25].ml_meth = NULL; 
     586        pmd[25].ml_flags = 0; 
     587        pmd[25].ml_doc = NULL; 
     588 
    589589        return pmd; 
    590590} 
     
    593593{ 
    594594        /* initialize object type */ 
    595         PyTypeObject *ot = g_new(PyTypeObject, 1); 
     595        PyTypeObject *ot = g_new0(PyTypeObject, 1); 
    596596 
    597597#ifdef Py_TRACE_REFS 
     
    671671                typename = g_type_name(all_types[i]); 
    672672                PyTypeObject *ot = __new_object_struct(typename); 
    673                  
    674673                pygobject_register_class(d, 
    675                                 typename, all_types[i], ot,  
    676                                 Py_BuildValue("(O)", pygobject_type)); 
     674                                typename, all_types[i], ot, NULL); 
     675                                /* FIXME, What is a static bases in this case? */ 
     676                                /* Py_BuildValue("(O)", pygobject_type)); */ 
    677677                 
    678678                g_hash_table_insert(_pytype_hash,