summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/swig/gnuradio.i3
-rw-r--r--gnuradio-core/src/lib/swig/gr_swig_block_magic.i10
-rw-r--r--gnuradio-core/src/python/build_utils.py4
3 files changed, 14 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i
index 239223851..3a421ad5d 100644
--- a/gnuradio-core/src/lib/swig/gnuradio.i
+++ b/gnuradio-core/src/lib/swig/gnuradio.i
@@ -20,6 +20,9 @@
* Boston, MA 02110-1301, USA.
*/
+// Disable warning about base class types
+#pragma SWIG nowarn=401
+
////////////////////////////////////////////////////////////////////////
// gnuradio.i
// SWIG interface definition
diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i
index cdc9fbe49..4016ae772 100644
--- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i
+++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -40,3 +40,11 @@ FULL_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(),
%}
%enddef
#endif
+
+%define GR_SWIG_BLOCK_MAGIC2(PKG, BASE_NAME)
+%template(BASE_NAME ## _sptr) boost::shared_ptr<gr:: ## PKG ## :: ## BASE_NAME>;
+%pythoncode %{
+BASE_NAME ## _sptr.__repr__ = lambda self: "<gr_block %s (%d)>" % (self.name(), self.unique_id())
+BASE_NAME = BASE_NAME.make;
+%}
+%enddef
diff --git a/gnuradio-core/src/python/build_utils.py b/gnuradio-core/src/python/build_utils.py
index 0660941d5..ce0757912 100644
--- a/gnuradio-core/src/python/build_utils.py
+++ b/gnuradio-core/src/python/build_utils.py
@@ -176,11 +176,11 @@ def is_complex (code3):
return '0'
-def standard_dict (name, code3):
+def standard_dict (name, code3, package='gr'):
d = {}
d['NAME'] = name
d['GUARD_NAME'] = 'INCLUDED_%s_H' % name.upper ()
- d['BASE_NAME'] = re.sub ('^gr_', '', name)
+ d['BASE_NAME'] = re.sub ('^' + package + '_', '', name)
d['SPTR_NAME'] = '%s_sptr' % name
d['WARNING'] = 'WARNING: this file is machine generated. Edits will be over written'
d['COPYRIGHT'] = copyright