Skip to content

Commit 7f452da

Browse files
author
Arzaroth Lekva
committed
renaming extension
1 parent b3e8df9 commit 7f452da

File tree

9 files changed

+29
-28
lines changed

9 files changed

+29
-28
lines changed

rapidxml/c_ext/src/attribute_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static PyMethodDef rapidxml_AttributeObject_methods[] = {
7474

7575
PyTypeObject rapidxml_AttributeType = {
7676
PyVarObject_HEAD_INIT(NULL, 0)
77-
"_rapidxml.Attribute", /* tp_name */
77+
"rapidxml.c_ext.Attribute", /* tp_name */
7878
sizeof(rapidxml_AttributeObject), /* tp_basicsize */
7979
0, /* tp_itemsize */
8080
0, /* tp_dealloc */

rapidxml/c_ext/src/attributeiterator_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static PyObject* rapidxml_AttributeIteratorObject_iternext(rapidxml_AttributeIte
6060

6161
PyTypeObject rapidxml_AttributeIteratorType = {
6262
PyVarObject_HEAD_INIT(NULL, 0)
63-
"_rapidxml.AttributeIterator", /* tp_name */
63+
"rapidxml.c_ext.AttributeIterator", /* tp_name */
6464
sizeof(rapidxml_AttributeIteratorObject), /* tp_basicsize */
6565
0, /* tp_itemsize */
6666
reinterpret_cast<destructor>(rapidxml_AttributeIteratorObject_dealloc), /* tp_dealloc */

rapidxml/c_ext/src/base_object.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static PyObject* rapidxml_BaseObject_copy(rapidxml_BaseObject* self,
4848
return NULL;
4949
}
5050
if (!IS_BASE(other)) {
51-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Base");
51+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Base");
5252
return NULL;
5353
}
5454
self->underlying_obj = reinterpret_cast<rapidxml_BaseObject*>(other)->underlying_obj;
@@ -64,7 +64,7 @@ static PyObject* rapidxml_BaseObject_richcmp(PyObject* obj1,
6464
bool c;
6565

6666
if (!(IS_BASE(obj1) && IS_BASE(obj2))) {
67-
PyErr_SetString(PyExc_TypeError, "Expected instances of _rapidxml.Base");
67+
PyErr_SetString(PyExc_TypeError, "Expected instances of rapidxml.c_ext.Base");
6868
return NULL;
6969
}
7070
switch (op) {
@@ -209,7 +209,7 @@ static PyMethodDef rapidxml_BaseObject_methods[] = {
209209

210210
PyTypeObject rapidxml_BaseType = {
211211
PyVarObject_HEAD_INIT(NULL, 0)
212-
"_rapidxml.Base", /* tp_name */
212+
"rapidxml.c_ext.Base", /* tp_name */
213213
sizeof(rapidxml_BaseObject), /* tp_basicsize */
214214
0, /* tp_itemsize */
215215
reinterpret_cast<destructor>(rapidxml_BaseObject_dealloc), /* tp_dealloc */

rapidxml/c_ext/src/document_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static PyMethodDef rapidxml_DocumentObject_methods[] = {
165165

166166
PyTypeObject rapidxml_DocumentType = {
167167
PyVarObject_HEAD_INIT(NULL, 0)
168-
"_rapidxml.Document", /* tp_name */
168+
"rapidxml.c_ext.Document", /* tp_name */
169169
sizeof(rapidxml_DocumentObject), /* tp_basicsize */
170170
0, /* tp_itemsize */
171171
reinterpret_cast<destructor>(rapidxml_DocumentObject_dealloc), /* tp_dealloc */

rapidxml/c_ext/src/node_object.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static PyObject* rapidxml_NodeObject_prepend_node(rapidxml_NodeObject* self,
173173
return NULL;
174174
}
175175
if (!IS_NODE(node)) {
176-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Node");
176+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Node");
177177
return NULL;
178178
}
179179
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->prepend_node
@@ -195,7 +195,7 @@ static PyObject* rapidxml_NodeObject_append_node(rapidxml_NodeObject* self,
195195
return NULL;
196196
}
197197
if (!IS_NODE(node)) {
198-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Node");
198+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Node");
199199
return NULL;
200200
}
201201
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->append_node
@@ -219,7 +219,7 @@ static PyObject* rapidxml_NodeObject_insert_node(rapidxml_NodeObject* self,
219219
return NULL;
220220
}
221221
if (!(IS_NODE(where) && IS_NODE(node))) {
222-
PyErr_SetString(PyExc_TypeError, "Expected instances of _rapidxml.Node");
222+
PyErr_SetString(PyExc_TypeError, "Expected instances of rapidxml.c_ext.Node");
223223
return NULL;
224224
}
225225
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->insert_node
@@ -263,7 +263,7 @@ static PyObject* rapidxml_NodeObject_remove_node(rapidxml_NodeObject* self,
263263
return NULL;
264264
}
265265
if (!IS_NODE(node)) {
266-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Node");
266+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Node");
267267
return NULL;
268268
}
269269
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->remove_node
@@ -293,7 +293,7 @@ static PyObject* rapidxml_NodeObject_prepend_attribute(rapidxml_NodeObject* self
293293
return NULL;
294294
}
295295
if (!IS_ATTR(attribute)) {
296-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Attribute");
296+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Attribute");
297297
return NULL;
298298
}
299299
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->prepend_attribute
@@ -315,7 +315,7 @@ static PyObject* rapidxml_NodeObject_append_attribute(rapidxml_NodeObject* self,
315315
return NULL;
316316
}
317317
if (!IS_ATTR(attribute)) {
318-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Attribute");
318+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Attribute");
319319
return NULL;
320320
}
321321
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->append_attribute
@@ -339,7 +339,7 @@ static PyObject* rapidxml_NodeObject_insert_attribute(rapidxml_NodeObject* self,
339339
return NULL;
340340
}
341341
if (!(IS_ATTR(where) && IS_ATTR(attribute))) {
342-
PyErr_SetString(PyExc_TypeError, "Expected instances of _rapidxml.Attribute");
342+
PyErr_SetString(PyExc_TypeError, "Expected instances of rapidxml.c_ext.Attribute");
343343
return NULL;
344344
}
345345
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->insert_attribute
@@ -383,7 +383,7 @@ static PyObject* rapidxml_NodeObject_remove_attribute(rapidxml_NodeObject* self,
383383
return NULL;
384384
}
385385
if (!IS_ATTR(attribute)) {
386-
PyErr_SetString(PyExc_TypeError, "Expected instance of _rapidxml.Attribute");
386+
PyErr_SetString(PyExc_TypeError, "Expected instance of rapidxml.c_ext.Attribute");
387387
return NULL;
388388
}
389389
static_cast<rapidxml::xml_node<>*>(self->base.underlying_obj)->remove_attribute
@@ -528,7 +528,7 @@ static PyMethodDef rapidxml_NodeObject_methods[] = {
528528

529529
PyTypeObject rapidxml_NodeType = {
530530
PyVarObject_HEAD_INIT(NULL, 0)
531-
"_rapidxml.Node", /* tp_name */
531+
"rapidxml.c_ext.Node", /* tp_name */
532532
sizeof(rapidxml_NodeObject), /* tp_basicsize */
533533
0, /* tp_itemsize */
534534
0, /* tp_dealloc */

rapidxml/c_ext/src/nodeiterator_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static PyObject* rapidxml_NodeIteratorObject_iternext(rapidxml_NodeIteratorObjec
6060

6161
PyTypeObject rapidxml_NodeIteratorType = {
6262
PyVarObject_HEAD_INIT(NULL, 0)
63-
"_rapidxml.NodeIterator", /* tp_name */
63+
"rapidxml.c_ext.NodeIterator", /* tp_name */
6464
sizeof(rapidxml_NodeIteratorObject), /* tp_basicsize */
6565
0, /* tp_itemsize */
6666
reinterpret_cast<destructor>(rapidxml_NodeIteratorObject_dealloc), /* tp_dealloc */

rapidxml/c_ext/src/rapidxml_module.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static PyMethodDef module_methods[] = {
2222

2323
static struct PyModuleDef moduledef = {
2424
PyModuleDef_HEAD_INIT,
25-
"_rapidxml",
25+
"rapidxml.c_ext",
2626
"python module for rapidxml bindings",
2727
-1,
2828
module_methods,
@@ -34,12 +34,12 @@ static struct PyModuleDef moduledef = {
3434

3535
# define INITERROR return NULL
3636

37-
PyMODINIT_FUNC PyInit__rapidxml(void)
37+
PyMODINIT_FUNC PyInit_c_ext(void)
3838

3939
#else
4040
# define INITERROR return
4141

42-
PyMODINIT_FUNC init_rapidxml(void)
42+
PyMODINIT_FUNC initc_ext(void)
4343
#endif
4444
{
4545
PyObject* module;
@@ -64,7 +64,7 @@ PyMODINIT_FUNC init_rapidxml(void)
6464
#if PY_MAJOR_VERSION >= 3
6565
module = PyModule_Create(&moduledef);
6666
#else
67-
module = Py_InitModule3("_rapidxml",
67+
module = Py_InitModule3("rapidxml.c_ext",
6868
module_methods,
6969
"rapidxml module for rapidxml bindings");
7070
#endif
@@ -101,7 +101,7 @@ PyMODINIT_FUNC init_rapidxml(void)
101101
"AttributeIterator",
102102
reinterpret_cast<PyObject *>(&rapidxml_AttributeIteratorType));
103103

104-
rapidxml_RapidXmlError = PyErr_NewException("_rapidxml.RapidXmlError",
104+
rapidxml_RapidXmlError = PyErr_NewException("rapidxml.c_ext.RapidXmlError",
105105
NULL, NULL);
106106
Py_INCREF(rapidxml_RapidXmlError);
107107
PyModule_AddObject(module,

rapidxml/rapidxml.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# arzaroth@arzaroth.com
77
#
88

9-
import _rapidxml
9+
from __future__ import absolute_import
10+
import rapidxml.c_ext
1011

1112
class DictNodeIterator(object):
1213
def __init__(self,
@@ -31,9 +32,9 @@ def __iter__(self):
3132
return self
3233

3334

34-
class DictNode(_rapidxml.Node):
35+
class DictNode(rapidxml.c_ext.Node):
3536
def __init__(self, attribute_prefix='@', cdata_key='#text', always_aslist=False):
36-
_rapidxml.Node.__init__(self)
37+
rapidxml.c_ext.Node.__init__(self)
3738
self.attribute_prefix = attribute_prefix
3839
self.cdata_key = cdata_key
3940
self.always_aslist = always_aslist
@@ -94,15 +95,15 @@ def __iter__(self):
9495
self.always_aslist)
9596

9697

97-
class RapidXml(DictNode, _rapidxml.Document):
98+
class RapidXml(DictNode, rapidxml.c_ext.Document):
9899
def __init__(self,
99100
text="",
100101
from_file=False,
101102
attribute_prefix='@',
102103
cdata_key='#text',
103104
always_aslist=False):
104105
DictNode.__init__(self, attribute_prefix, cdata_key, always_aslist)
105-
_rapidxml.Document.__init__(self, text, from_file)
106+
rapidxml.c_ext.Document.__init__(self, text, from_file)
106107

107108
def allocate_node(self, *args):
108109
return DictNode(self.attribute_prefix,

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
from setuptools import setup, Extension, find_packages
1010

11-
VERSION = ("1", "0", "7")
11+
VERSION = ("2", "0", "0")
1212

13-
rapidxml = Extension("_rapidxml",
13+
rapidxml = Extension("rapidxml.c_ext",
1414
define_macros=[('MAJOR_VERSION', VERSION[0]),
1515
('MINOR_VERSION', VERSION[1])],
1616
include_dirs=[

0 commit comments

Comments
 (0)