[Commits] (vajda) - added COPYEXPORT and IMPORTING flags
commits at osafoundation.org
commits at osafoundation.org
Mon Apr 18 11:30:58 PDT 2005
Commit by: vajda
Modified files:
internal/chandlerdb/Makefile 1.13 1.14
internal/chandlerdb/chandlerdb/item/item.c 1.2 1.3
internal/chandlerdb/chandlerdb/item/item.h 1.2 1.3
internal/chandlerdb/chandlerdb/schema/descriptor.c 1.8 1.9
Log message:
- added COPYEXPORT and IMPORTING flags
- fixed bug when __get__ is passed NULL or None obj
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/chandlerdb/Makefile.diff?r1=text&tr1=1.13&r2=text&tr2=1.14
http://cvs.osafoundation.org/index.cgi/internal/chandlerdb/chandlerdb/item/item.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/internal/chandlerdb/chandlerdb/item/item.h.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/internal/chandlerdb/chandlerdb/schema/descriptor.c.diff?r1=text&tr1=1.8&r2=text&tr2=1.9
Index: internal/chandlerdb/chandlerdb/item/item.c
diff -u internal/chandlerdb/chandlerdb/item/item.c:1.2 internal/chandlerdb/chandlerdb/item/item.c:1.3
--- internal/chandlerdb/chandlerdb/item/item.c:1.2 Fri Mar 25 13:30:10 2005
+++ internal/chandlerdb/chandlerdb/item/item.c Mon Apr 18 11:30:55 2005
@@ -16,9 +16,12 @@
static PyObject *t_item_isDeleted(t_item *self, PyObject *args);
static PyObject *t_item_isStale(t_item *self, PyObject *args);
static PyObject *t_item_isPinned(t_item *self, PyObject *args);
+static PyObject *t_item_isSchema(t_item *self, PyObject *args);
static PyObject *t_item_isDirty(t_item *self, PyObject *args);
static PyObject *t_item_getDirty(t_item *self, PyObject *args);
static PyObject *t_item__isNDirty(t_item *self, PyObject *args);
+static PyObject *t_item__isCopyExport(t_item *self, PyObject *args);
+static PyObject *t_item__isImporting(t_item *self, PyObject *args);
static PyObject *t_item__isRepository(t_item *self, PyObject *args);
static PyObject *t_item__isView(t_item *self, PyObject *args);
static PyObject *t_item__isItem(t_item *self, PyObject *args);
@@ -82,9 +85,12 @@
{ "isDeleted", (PyCFunction) t_item_isDeleted, METH_NOARGS, isDeleted_DOC },
{ "isStale", (PyCFunction) t_item_isStale, METH_NOARGS, isStale_DOC },
{ "isPinned", (PyCFunction) t_item_isPinned, METH_NOARGS, isPinned_DOC },
+ { "isSchema", (PyCFunction) t_item_isSchema, METH_NOARGS, "" },
{ "isDirty", (PyCFunction) t_item_isDirty, METH_NOARGS, isDirty_DOC },
{ "getDirty", (PyCFunction) t_item_getDirty, METH_NOARGS, getDirty_DOC },
{ "_isNDirty", (PyCFunction) t_item__isNDirty, METH_NOARGS, "" },
+ { "_isCopyExport", (PyCFunction) t_item__isCopyExport, METH_NOARGS, "" },
+ { "_isImporting", (PyCFunction) t_item__isImporting, METH_NOARGS, "" },
{ "_isRepository", (PyCFunction) t_item__isRepository, METH_NOARGS, "" },
{ "_isView", (PyCFunction) t_item__isView, METH_NOARGS, "" },
{ "_isItem", (PyCFunction) t_item__isItem, METH_NOARGS, "" },
@@ -211,6 +217,14 @@
Py_RETURN_FALSE;
}
+static PyObject *t_item_isSchema(t_item *self, PyObject *args)
+{
+ if (self->status & SCHEMA)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
static PyObject *t_item_isDirty(t_item *self, PyObject *args)
{
if (self->status & DIRTY)
@@ -232,6 +246,22 @@
Py_RETURN_FALSE;
}
+static PyObject *t_item__isCopyExport(t_item *self, PyObject *args)
+{
+ if (self->status & COPYEXPORT)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
+static PyObject *t_item__isImporting(t_item *self, PyObject *args)
+{
+ if (self->status & IMPORTING)
+ Py_RETURN_TRUE;
+ else
+ Py_RETURN_FALSE;
+}
+
static PyObject *t_item__isRepository(t_item *self, PyObject *args)
{
Py_RETURN_FALSE;
@@ -301,6 +331,8 @@
PyDict_SetItemString_Int(dict, "RMERGED", RMERGED);
PyDict_SetItemString_Int(dict, "NMERGED", NMERGED);
PyDict_SetItemString_Int(dict, "CMERGED", CMERGED);
+ PyDict_SetItemString_Int(dict, "COPYEXPORT", COPYEXPORT);
+ PyDict_SetItemString_Int(dict, "IMPORTING", IMPORTING);
PyDict_SetItemString_Int(dict, "VRDIRTY", VRDIRTY);
PyDict_SetItemString_Int(dict, "DIRTY", DIRTY);
Index: internal/chandlerdb/Makefile
diff -u internal/chandlerdb/Makefile:1.13 internal/chandlerdb/Makefile:1.14
--- internal/chandlerdb/Makefile:1.13 Mon Apr 4 15:03:31 2005
+++ internal/chandlerdb/Makefile Mon Apr 18 11:30:55 2005
@@ -1,7 +1,7 @@
include ../Makefile.inc
-RELVER=0.5-6
+RELVER=0.5-7
CHANDLERDB=$(INTERNAL)/chandlerdb
BUILD=build_$(SNAP)
Index: internal/chandlerdb/chandlerdb/item/item.h
diff -u internal/chandlerdb/chandlerdb/item/item.h:1.2 internal/chandlerdb/chandlerdb/item/item.h:1.3
--- internal/chandlerdb/chandlerdb/item/item.h:1.2 Fri Mar 25 13:30:10 2005
+++ internal/chandlerdb/chandlerdb/item/item.h Mon Apr 18 11:30:55 2005
@@ -36,6 +36,8 @@
RMERGED = 0x00020000,
NMERGED = 0x00040000,
CMERGED = 0x00080000,
+ COPYEXPORT = 0x00100000, /* item instance is copied on export */
+ IMPORTING = 0x00200000, /* item is being imported */
};
enum {
Index: internal/chandlerdb/chandlerdb/schema/descriptor.c
diff -u internal/chandlerdb/chandlerdb/schema/descriptor.c:1.8 internal/chandlerdb/chandlerdb/schema/descriptor.c:1.9
--- internal/chandlerdb/chandlerdb/schema/descriptor.c:1.8 Mon Apr 4 15:03:32 2005
+++ internal/chandlerdb/chandlerdb/schema/descriptor.c Mon Apr 18 11:30:56 2005
@@ -181,10 +181,10 @@
static PyObject *t_descriptor___get__(t_descriptor *self,
PyObject *obj, PyObject *type)
{
- if (obj == Py_None)
+ if (obj == NULL || obj == Py_None)
{
- PyErr_SetObject(PyExc_AttributeError, self->name);
- return NULL;
+ Py_INCREF(self);
+ return (PyObject *) self;
}
else if (((t_item *) obj)->status & STALE)
{
More information about the Commits
mailing list