summaryrefslogtreecommitdiffstats
path: root/python-ethtool/ethtool.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2014-01-09 19:50:05 +0100
committerDavid Sommerseth <davids@redhat.com>2014-01-09 19:50:05 +0100
commit8156c8880b5148fe2ea19950b2229e1bb80b431c (patch)
tree1a4dac301e3f58fac281bdad8f2f2fde0d859e82 /python-ethtool/ethtool.c
parenta5308a1856bbf5268b9f51c87ec3da032c371a6f (diff)
downloadpython-ethtool-8156c8880b5148fe2ea19950b2229e1bb80b431c.tar.gz
python-ethtool-8156c8880b5148fe2ea19950b2229e1bb80b431c.tar.xz
python-ethtool-8156c8880b5148fe2ea19950b2229e1bb80b431c.zip
cleanup: Rename etherinfo_py and ethtool_etherinfo_Type
Use PyEtherInfo and PyEtherInfoType the base names, to more easily see their relation, and more clearly indicate they are Python objects. Also remove an initialisation of PyEtherInfo/etherinfo_py not needed any more. Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'python-ethtool/ethtool.c')
-rw-r--r--python-ethtool/ethtool.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/python-ethtool/ethtool.c b/python-ethtool/ethtool.c
index 146618f..65abb21 100644
--- a/python-ethtool/ethtool.c
+++ b/python-ethtool/ethtool.c
@@ -32,7 +32,7 @@
#include "etherinfo_obj.h"
#include "etherinfo.h"
-extern PyTypeObject ethtool_etherinfoType;
+extern PyTypeObject PyEtherInfo_Type;
#ifndef IFF_DYNAMIC
#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
@@ -268,13 +268,13 @@ static PyObject *get_interfaces_info(PyObject *self __unused, PyObject *args) {
devlist = PyList_New(0);
for( i = 0; i < fetch_devs_len; i++ ) {
- etherinfo_py *dev = NULL;
+ PyEtherInfo *dev = NULL;
/* Store the device name and a reference to the NETLINK connection for
* objects to use when quering for device info
*/
- dev = PyObject_New(etherinfo_py, &ethtool_etherinfoType);
+ dev = PyObject_New(PyEtherInfo, &PyEtherInfo_Type);
if( !dev ) {
PyErr_SetString(PyExc_OSError, strerror(errno));
free(fetch_devs);
@@ -939,10 +939,8 @@ PyMODINIT_FUNC initethtool(void)
m = Py_InitModule3("ethtool", PyEthModuleMethods, "Python ethtool module");
// Prepare the ethtool.etherinfo class
- if (PyType_Ready(&ethtool_etherinfoType) < 0)
+ if (PyType_Ready(&PyEtherInfo_Type) < 0)
return;
- Py_INCREF(&ethtool_etherinfoType);
- PyModule_AddObject(m, "etherinfo", (PyObject *)&ethtool_etherinfoType);
// Prepare the ethtool IPv6 and IPv4 address types
if (PyType_Ready(&ethtool_netlink_ip_address_Type))