Skip to content

Commit ee17b41

Browse files
committed
Clean up module flotsam
[SVN r15720]
1 parent 5e8d775 commit ee17b41

1 file changed

Lines changed: 2 additions & 38 deletions

File tree

src/module.cpp

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,19 @@
66
// The author gratefully acknowleges the support of Dragon Systems, Inc., in
77
// producing this work.
88

9-
#include <boost/python/object/function_object.hpp>
10-
#include <boost/python/detail/module_base.hpp>
11-
#include <boost/python/cast.hpp>
12-
#include <boost/python/scope.hpp>
13-
#include <boost/python/borrowed.hpp>
14-
#include <boost/python/object.hpp>
15-
#include <boost/python/detail/raw_pyobject.hpp>
169
#include <boost/python/scope.hpp>
10+
#include <boost/python/object/add_to_namespace.hpp>
1711

1812
namespace boost { namespace python { namespace detail {
1913

20-
module_base::module_base(char const* name, char const* doc)
21-
: m_module(
22-
allow_null(python::borrowed(
23-
scope().ptr()
24-
)))
25-
{
26-
if (doc != 0)
27-
scope().attr("__doc__") = doc;
28-
}
29-
30-
module_base::~module_base()
31-
{
32-
}
33-
34-
void module_base::setattr_doc(const char* name, python::object const& x, char const* doc)
35-
{
36-
// Use function::add_to_namespace to achieve overloading if
37-
// appropriate.
38-
objects::add_to_namespace(python::object(m_module), name, x, doc);
39-
}
40-
41-
void BOOST_PYTHON_DECL scope_setattr_doc(char const* name, object const& x, char const* doc)
14+
BOOST_PYTHON_DECL void scope_setattr_doc(char const* name, object const& x, char const* doc)
4215
{
4316
// Use function::add_to_namespace to achieve overloading if
4417
// appropriate.
4518
scope current;
4619
objects::add_to_namespace(current, name, x, doc);
4720
}
4821

49-
void module_base::add(type_handle const& x)
50-
{
51-
this->setattr_doc(x->tp_name, python::object(x), 0);
52-
}
53-
54-
PyMethodDef module_base::initial_methods[] = { { 0, 0, 0, 0 } };
55-
5622
namespace
5723
{
5824
PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } };
@@ -66,8 +32,6 @@ BOOST_PYTHON_DECL void init_module(char const* name, void(*init_function)())
6632

6733
if (m != 0)
6834
{
69-
;
70-
7135
// Create the current module scope
7236
scope current_module(
7337
(object(

0 commit comments

Comments
 (0)