Final work on adjusting attribute, method and parameter names to be
consistent and to comply with PEP 8 naming guidelines.
This commit is contained in:
parent
96f938286d
commit
8c99d1ddde
@ -48,6 +48,8 @@ if applicable. The most recent deprecations are listed first.
|
|||||||
- Replace with parameter name `session_callback`
|
- Replace with parameter name `session_callback`
|
||||||
* - `maxSessionsPerShard` parameter to :meth:`cx_Oracle.SessionPool()`
|
* - `maxSessionsPerShard` parameter to :meth:`cx_Oracle.SessionPool()`
|
||||||
- Replace with parameter name `max_sessions_per_shard`
|
- Replace with parameter name `max_sessions_per_shard`
|
||||||
|
* - `SessionPool.tnsentry`
|
||||||
|
- Replace with :data:`SessionPool.dsn`
|
||||||
* - `payloadType` parameter to :meth:`Connection.queue()`
|
* - `payloadType` parameter to :meth:`Connection.queue()`
|
||||||
- Replace with parameter name `payload_type` if using keyword parameters.
|
- Replace with parameter name `payload_type` if using keyword parameters.
|
||||||
* - `ipAddress` parameter to :meth:`Connection.subscribe()`
|
* - `ipAddress` parameter to :meth:`Connection.subscribe()`
|
||||||
@ -72,6 +74,8 @@ if applicable. The most recent deprecations are listed first.
|
|||||||
- Replace with parameter name `encoding_errors`
|
- Replace with parameter name `encoding_errors`
|
||||||
* - `Cursor.fetchraw()`
|
* - `Cursor.fetchraw()`
|
||||||
- Replace with :meth:`Cursor.fetchmany()`
|
- Replace with :meth:`Cursor.fetchmany()`
|
||||||
|
* - `newSize` parameter to :meth:`LOB.trim()`
|
||||||
|
- Replace with parameter name `new_size`
|
||||||
* - `Queue.deqMany`
|
* - `Queue.deqMany`
|
||||||
- Replace with :meth:`Queue.deqmany()`
|
- Replace with :meth:`Queue.deqmany()`
|
||||||
* - `Queue.deqOne`
|
* - `Queue.deqOne`
|
||||||
@ -86,6 +90,18 @@ if applicable. The most recent deprecations are listed first.
|
|||||||
- Replace with :meth:`Queue.enqoptions`
|
- Replace with :meth:`Queue.enqoptions`
|
||||||
* - `Queue.payloadType`
|
* - `Queue.payloadType`
|
||||||
- Replace with :meth:`Queue.payload_type`
|
- Replace with :meth:`Queue.payload_type`
|
||||||
|
* - `Subscription.ipAddress`
|
||||||
|
- Replace with :attr:`Subscription.ip_address`
|
||||||
|
* - `Message.consumerName`
|
||||||
|
- Replace with :attr:`Message.consumer_name`
|
||||||
|
* - `Message.queueName`
|
||||||
|
- Replace with :attr:`Message.queue_name`
|
||||||
|
* - `Variable.actualElements`
|
||||||
|
- Replace with :attr:`Variable.actual_elements`
|
||||||
|
* - `Variable.bufferSize`
|
||||||
|
- Replace with :attr:`Variable.buffer_size`
|
||||||
|
* - `Variable.numElements`
|
||||||
|
- Replace with :attr:`Variable.num_elements`
|
||||||
|
|
||||||
|
|
||||||
.. list-table:: Deprecated in 8.0
|
.. list-table:: Deprecated in 8.0
|
||||||
|
|||||||
@ -74,7 +74,7 @@ See :ref:`lobdata` for more information about using LOBs.
|
|||||||
for all but supplemental characters.
|
for all but supplemental characters.
|
||||||
|
|
||||||
|
|
||||||
.. method:: LOB.trim([newSize=0])
|
.. method:: LOB.trim(new_size=0)
|
||||||
|
|
||||||
Trim the LOB to the new size.
|
Trim the LOB to the new size.
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ See :ref:`lobdata` for more information about using LOBs.
|
|||||||
.. versionadded:: 8.0
|
.. versionadded:: 8.0
|
||||||
|
|
||||||
|
|
||||||
.. method:: LOB.write(data, [offset=1])
|
.. method:: LOB.write(data, offset=1)
|
||||||
|
|
||||||
Write the data to the LOB object at the given offset. The offset is in
|
Write the data to the LOB object at the given offset. The offset is in
|
||||||
bytes for BLOB type LOBs and in UCS-2 code points for CLOB and NCLOB type
|
bytes for BLOB type LOBs and in UCS-2 code points for CLOB and NCLOB type
|
||||||
|
|||||||
@ -185,6 +185,10 @@ SessionPool Object
|
|||||||
This read-only attribute returns the TNS entry of the database to which a
|
This read-only attribute returns the TNS entry of the database to which a
|
||||||
connection has been established.
|
connection has been established.
|
||||||
|
|
||||||
|
.. deprecated:: 8.2
|
||||||
|
|
||||||
|
Use the attribute :attr:`~SessionPool.dsn` instead.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: SessionPool.username
|
.. attribute:: SessionPool.username
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ Subscription Object
|
|||||||
subscriptions, the value is 0.
|
subscriptions, the value is 0.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Subscription.ipAddress
|
.. attribute:: Subscription.ip_address
|
||||||
|
|
||||||
This read-only attribute returns the IP address used for callback
|
This read-only attribute returns the IP address used for callback
|
||||||
notifications from the database server. If not set during construction,
|
notifications from the database server. If not set during construction,
|
||||||
@ -37,6 +37,12 @@ Subscription Object
|
|||||||
|
|
||||||
.. versionadded:: 6.4
|
.. versionadded:: 6.4
|
||||||
|
|
||||||
|
.. versionchanged:: 8.2
|
||||||
|
|
||||||
|
For consistency and compliance with the PEP 8 naming style, the
|
||||||
|
attribute `ipAddress` was renamed to `ip_address`. The old name will
|
||||||
|
continue to work for a period of time.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Subscription.name
|
.. attribute:: Subscription.name
|
||||||
|
|
||||||
@ -106,7 +112,7 @@ Message Objects
|
|||||||
to the callback procedure specified when a subscription is created.
|
to the callback procedure specified when a subscription is created.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Message.consumerName
|
.. attribute:: Message.consumer_name
|
||||||
|
|
||||||
This read-only attribute returns the name of the consumer which generated
|
This read-only attribute returns the name of the consumer which generated
|
||||||
the notification. It will be populated if the subscription was created with
|
the notification. It will be populated if the subscription was created with
|
||||||
@ -115,6 +121,12 @@ Message Objects
|
|||||||
|
|
||||||
.. versionadded:: 6.4
|
.. versionadded:: 6.4
|
||||||
|
|
||||||
|
.. versionchanged:: 8.2
|
||||||
|
|
||||||
|
For consistency and compliance with the PEP 8 naming style, the
|
||||||
|
attribute `consumerName` was renamed to `consumer_name`. The old name
|
||||||
|
will continue to work for a period of time.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Message.dbname
|
.. attribute:: Message.dbname
|
||||||
|
|
||||||
@ -130,7 +142,7 @@ Message Objects
|
|||||||
:data:`~cx_Oracle.SUBSCR_QOS_QUERY` when the subscription was created.
|
:data:`~cx_Oracle.SUBSCR_QOS_QUERY` when the subscription was created.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Message.queueName
|
.. attribute:: Message.queue_name
|
||||||
|
|
||||||
This read-only attribute returns the name of the queue which generated the
|
This read-only attribute returns the name of the queue which generated the
|
||||||
notification. It will only be populated if the subscription was created
|
notification. It will only be populated if the subscription was created
|
||||||
@ -138,6 +150,12 @@ Message Objects
|
|||||||
|
|
||||||
.. versionadded:: 6.4
|
.. versionadded:: 6.4
|
||||||
|
|
||||||
|
.. versionchanged:: 8.2
|
||||||
|
|
||||||
|
For consistency and compliance with the PEP 8 naming style, the
|
||||||
|
attribute `queueName` was renamed to `queue_name`. The old name will
|
||||||
|
continue to work for a period of time.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Message.registered
|
.. attribute:: Message.registered
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ Variable Objects
|
|||||||
The DB API definition does not define this object.
|
The DB API definition does not define this object.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Variable.actualElements
|
.. attribute:: Variable.actual_elements
|
||||||
|
|
||||||
This read-only attribute returns the actual number of elements in the
|
This read-only attribute returns the actual number of elements in the
|
||||||
variable. This corresponds to the number of elements in a PL/SQL index-by
|
variable. This corresponds to the number of elements in a PL/SQL index-by
|
||||||
@ -17,11 +17,24 @@ Variable Objects
|
|||||||
:func:`Cursor.arrayvar()`. For all other variables this value will be
|
:func:`Cursor.arrayvar()`. For all other variables this value will be
|
||||||
identical to the attribute :attr:`~Variable.numElements`.
|
identical to the attribute :attr:`~Variable.numElements`.
|
||||||
|
|
||||||
.. attribute:: Variable.bufferSize
|
.. versionchanged:: 8.2
|
||||||
|
|
||||||
|
For consistency and compliance with the PEP 8 naming style, the
|
||||||
|
attribute `actualElements` was renamed to `actual_elements`. The old
|
||||||
|
name will continue to work for a period of time.
|
||||||
|
|
||||||
|
|
||||||
|
.. attribute:: Variable.buffer_size
|
||||||
|
|
||||||
This read-only attribute returns the size of the buffer allocated for each
|
This read-only attribute returns the size of the buffer allocated for each
|
||||||
element in bytes.
|
element in bytes.
|
||||||
|
|
||||||
|
.. versionchanged:: 8.2
|
||||||
|
|
||||||
|
For consistency and compliance with the PEP 8 naming style, the
|
||||||
|
attribute `bufferSize` was renamed to `buffer_size`. The old
|
||||||
|
name will continue to work for a period of time.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Variable.getvalue([pos=0])
|
.. method:: Variable.getvalue([pos=0])
|
||||||
|
|
||||||
@ -41,12 +54,18 @@ Variable Objects
|
|||||||
attribute is None, the value is bound directly without any conversion.
|
attribute is None, the value is bound directly without any conversion.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Variable.numElements
|
.. attribute:: Variable.num_elements
|
||||||
|
|
||||||
This read-only attribute returns the number of elements allocated in an
|
This read-only attribute returns the number of elements allocated in an
|
||||||
array, or the number of scalar items that can be fetched into the variable
|
array, or the number of scalar items that can be fetched into the variable
|
||||||
or bound to the variable.
|
or bound to the variable.
|
||||||
|
|
||||||
|
.. versionchanged:: 8.2
|
||||||
|
|
||||||
|
For consistency and compliance with the PEP 8 naming style, the
|
||||||
|
attribute `numElements` was renamed to `num_elements`. The old
|
||||||
|
name will continue to work for a period of time.
|
||||||
|
|
||||||
|
|
||||||
.. attribute:: Variable.outconverter
|
.. attribute:: Variable.outconverter
|
||||||
|
|
||||||
|
|||||||
18
src/cxoLob.c
18
src/cxoLob.c
@ -236,14 +236,22 @@ static PyObject *cxoLob_write(cxoLob *lob, PyObject *args,
|
|||||||
static PyObject *cxoLob_trim(cxoLob *lob, PyObject *args,
|
static PyObject *cxoLob_trim(cxoLob *lob, PyObject *args,
|
||||||
PyObject *keywordArgs)
|
PyObject *keywordArgs)
|
||||||
{
|
{
|
||||||
static char *keywordList[] = { "newSize", NULL };
|
static char *keywordList[] = { "new_size", "newSize", NULL };
|
||||||
unsigned PY_LONG_LONG newSize;
|
unsigned PY_LONG_LONG newSize, newSizeDeprecated;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
newSize = 0;
|
newSize = newSizeDeprecated = 0;
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, keywordArgs, "|K", keywordList,
|
if (!PyArg_ParseTupleAndKeywords(args, keywordArgs, "|KK", keywordList,
|
||||||
&newSize))
|
&newSize, &newSizeDeprecated))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
if (newSizeDeprecated > 0) {
|
||||||
|
if (newSize > 0) {
|
||||||
|
cxoError_raiseFromString(cxoProgrammingErrorException,
|
||||||
|
"new_size and newSize cannot both be specified");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
newSize = newSizeDeprecated;
|
||||||
|
}
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
status = dpiLob_trim(lob->handle, (uint64_t) newSize);
|
status = dpiLob_trim(lob->handle, (uint64_t) newSize);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|||||||
@ -416,12 +416,14 @@ static PyMemberDef cxoSubscrTypeMembers[] = {
|
|||||||
{ "namespace", T_UINT, offsetof(cxoSubscr, namespace), READONLY },
|
{ "namespace", T_UINT, offsetof(cxoSubscr, namespace), READONLY },
|
||||||
{ "name", T_OBJECT, offsetof(cxoSubscr, name), READONLY },
|
{ "name", T_OBJECT, offsetof(cxoSubscr, name), READONLY },
|
||||||
{ "protocol", T_UINT, offsetof(cxoSubscr, protocol), READONLY },
|
{ "protocol", T_UINT, offsetof(cxoSubscr, protocol), READONLY },
|
||||||
{ "ipAddress", T_OBJECT, offsetof(cxoSubscr, ipAddress), READONLY },
|
{ "ip_address", T_OBJECT, offsetof(cxoSubscr, ipAddress), READONLY },
|
||||||
{ "port", T_UINT, offsetof(cxoSubscr, port), READONLY },
|
{ "port", T_UINT, offsetof(cxoSubscr, port), READONLY },
|
||||||
{ "timeout", T_UINT, offsetof(cxoSubscr, timeout), READONLY },
|
{ "timeout", T_UINT, offsetof(cxoSubscr, timeout), READONLY },
|
||||||
{ "operations", T_UINT, offsetof(cxoSubscr, operations), READONLY },
|
{ "operations", T_UINT, offsetof(cxoSubscr, operations), READONLY },
|
||||||
{ "qos", T_UINT, offsetof(cxoSubscr, qos), READONLY },
|
{ "qos", T_UINT, offsetof(cxoSubscr, qos), READONLY },
|
||||||
{ "id", T_ULONG, offsetof(cxoSubscr, id), READONLY },
|
{ "id", T_ULONG, offsetof(cxoSubscr, id), READONLY },
|
||||||
|
// deprecated
|
||||||
|
{ "ipAddress", T_OBJECT, offsetof(cxoSubscr, ipAddress), READONLY },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -433,9 +435,13 @@ static PyMemberDef cxoMessageTypeMembers[] = {
|
|||||||
{ "txid", T_OBJECT, offsetof(cxoMessage, txId), READONLY },
|
{ "txid", T_OBJECT, offsetof(cxoMessage, txId), READONLY },
|
||||||
{ "tables", T_OBJECT, offsetof(cxoMessage, tables), READONLY },
|
{ "tables", T_OBJECT, offsetof(cxoMessage, tables), READONLY },
|
||||||
{ "queries", T_OBJECT, offsetof(cxoMessage, queries), READONLY },
|
{ "queries", T_OBJECT, offsetof(cxoMessage, queries), READONLY },
|
||||||
|
{ "queue_name", T_OBJECT, offsetof(cxoMessage, queueName), READONLY },
|
||||||
|
{ "consumer_name", T_OBJECT, offsetof(cxoMessage, consumerName),
|
||||||
|
READONLY },
|
||||||
|
{ "registered", T_BOOL, offsetof(cxoMessage, registered), READONLY },
|
||||||
|
// deprecated
|
||||||
{ "queueName", T_OBJECT, offsetof(cxoMessage, queueName), READONLY },
|
{ "queueName", T_OBJECT, offsetof(cxoMessage, queueName), READONLY },
|
||||||
{ "consumerName", T_OBJECT, offsetof(cxoMessage, consumerName), READONLY },
|
{ "consumerName", T_OBJECT, offsetof(cxoMessage, consumerName), READONLY },
|
||||||
{ "registered", T_BOOL, offsetof(cxoMessage, registered), READONLY },
|
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -722,10 +722,11 @@ static PyObject *cxoVar_repr(cxoVar *var)
|
|||||||
// declaration of members
|
// declaration of members
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static PyMemberDef cxoMembers[] = {
|
static PyMemberDef cxoMembers[] = {
|
||||||
|
{ "buffer_size", T_INT, offsetof(cxoVar, bufferSize), READONLY },
|
||||||
{ "bufferSize", T_INT, offsetof(cxoVar, bufferSize), READONLY },
|
{ "bufferSize", T_INT, offsetof(cxoVar, bufferSize), READONLY },
|
||||||
{ "inconverter", T_OBJECT, offsetof(cxoVar, inConverter), 0 },
|
{ "inconverter", T_OBJECT, offsetof(cxoVar, inConverter), 0 },
|
||||||
{ "numElements", T_INT, offsetof(cxoVar, allocatedElements),
|
{ "numElements", T_INT, offsetof(cxoVar, allocatedElements), READONLY },
|
||||||
READONLY },
|
{ "num_elements", T_INT, offsetof(cxoVar, allocatedElements), READONLY },
|
||||||
{ "outconverter", T_OBJECT, offsetof(cxoVar, outConverter), 0 },
|
{ "outconverter", T_OBJECT, offsetof(cxoVar, outConverter), 0 },
|
||||||
{ "size", T_INT, offsetof(cxoVar, size), READONLY },
|
{ "size", T_INT, offsetof(cxoVar, size), READONLY },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
@ -736,6 +737,7 @@ static PyMemberDef cxoMembers[] = {
|
|||||||
// declaration of calculated members
|
// declaration of calculated members
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static PyGetSetDef cxoCalcMembers[] = {
|
static PyGetSetDef cxoCalcMembers[] = {
|
||||||
|
{ "actual_elements", (getter) cxoVar_externalGetActualElements, 0, 0, 0 },
|
||||||
{ "actualElements", (getter) cxoVar_externalGetActualElements, 0, 0, 0 },
|
{ "actualElements", (getter) cxoVar_externalGetActualElements, 0, 0, 0 },
|
||||||
{ "type", (getter) cxoVar_getType, 0, 0, 0 },
|
{ "type", (getter) cxoVar_getType, 0, 0, 0 },
|
||||||
{ "values", (getter) cxoVar_externalGetValues, 0, 0, 0 },
|
{ "values", (getter) cxoVar_externalGetValues, 0, 0, 0 },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user