X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Fpython%2Fgnuradio%2Fgr%2F__init__.py;h=6f939c470d30b3f5fb284e50b98c3a5df2ee176b;hb=ea29b08aeb54227e6628f655ccfdb96fe4d8c378;hp=8adf7e3086137a116a2653614408d724a1316a27;hpb=18a684bf3dc144c48fc4cc6cc72f5070febd8074;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/python/gnuradio/gr/__init__.py b/gnuradio-core/src/python/gnuradio/gr/__init__.py index 8adf7e30..6f939c47 100644 --- a/gnuradio-core/src/python/gnuradio/gr/__init__.py +++ b/gnuradio-core/src/python/gnuradio/gr/__init__.py @@ -1,11 +1,11 @@ # -# Copyright 2003,2004,2006 Free Software Foundation, Inc. +# Copyright 2003,2004,2006,2008,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, @@ -24,12 +24,29 @@ # This is the main GNU Radio python module. # We pull the swig output and the other modules into the gnuradio.gr namespace +# Temporary workaround for ticket:181. +# Use leading underscores to avoid namespace pollution +import sys +_RTLD_GLOBAL = 0 +try: + from dl import RTLD_GLOBAL as _RTLD_GLOBAL +except ImportError: + try: + from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL + except ImportError: + pass + +if _RTLD_GLOBAL != 0: + _dlopenflags = sys.getdlopenflags() + sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) + from gnuradio_swig_python import * -from basic_flow_graph import * -from flow_graph import * from exceptions import * -from hier_block import * +from hier_block2 import * +from top_block import * +if _RTLD_GLOBAL != 0: + sys.setdlopenflags(_dlopenflags) # Restore original flags # create a couple of aliases serial_to_parallel = stream_to_vector @@ -38,3 +55,12 @@ parallel_to_serial = vector_to_stream # Force the preference database to be initialized from prefs import prefs +#alias old gr_add_vXX and gr_multiply_vXX +add_vcc = add_cc +add_vff = add_ff +add_vii = add_ii +add_vss = add_ss +multiply_vcc = multiply_cc +multiply_vff = multiply_ff +multiply_vii = multiply_ii +multiply_vss = multiply_ss