blob: b68df4a3fb4e97c3a7bcbf9a56f7448a84023118 [file] [log] [blame]
piotr437f5462014-02-04 17:57:25 +01001#
2# Copyright 2008,2009 Free Software Foundation, Inc.
3#
4# This application is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# This application is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17#
18
19# The presence of this file turns this directory into a Python package
20
21'''
22This is the GNU Radio GSM module. Place your Python package
23description here (python/__init__.py).
24'''
25
Vasil Velichkov6eea94f2019-09-08 02:47:57 +030026import os
27
28if "CMAKE_BINARY_DIR" in os.environ:
29 dirname, filename = os.path.split(os.path.abspath(__file__))
30
31 # As the directory structure in the repository is different then the one after the package
32 # gets installed we need to add those subdirectories to the __path__ otherwise python3 is
33 # not able to load the modules using the relative import syntax and grcc compilation and
34 # some unit tests fail.
35 __path__ += [
36 # Load the local (not yet installed) grgsm_swig from the ../swig subdirectory.
37 os.path.join(os.environ.get("CMAKE_BINARY_DIR"), "swig"),
38
39 # Load the local (not yet installed) python modules from the local subdirectories
40 os.path.join(dirname, "misc_utils"),
41 os.path.join(dirname, "receiver"),
42 os.path.join(dirname, "demapping"),
43 os.path.join(dirname, "transmitter"),
44 os.path.join(dirname, "trx")]
piotr437f5462014-02-04 17:57:25 +010045
Vasil Velichkov284f1db2019-11-15 23:47:12 +020046try:
47 # import swig generated symbols into the gsm namespace
48 from .grgsm_swig import *
piotr437f5462014-02-04 17:57:25 +010049
Vasil Velichkov284f1db2019-11-15 23:47:12 +020050 # import any pure python here
piotr6b78abc2014-07-08 23:29:13 +020051
Vasil Velichkov284f1db2019-11-15 23:47:12 +020052 #from fcch_burst_tagger import fcch_burst_tagger
53 #from sch_detector import sch_detector
54 #from fcch_detector import fcch_detector
55 from .clock_offset_corrector_tagged import clock_offset_corrector_tagged
56 from .gsm_input import gsm_input
57 from .gsm_bcch_ccch_demapper import gsm_bcch_ccch_demapper
58 from .gsm_bcch_ccch_sdcch4_demapper import gsm_bcch_ccch_sdcch4_demapper
59 from .gsm_sdcch8_demapper import gsm_sdcch8_demapper
60 from .gsm_gmsk_mod import gsm_gmsk_mod
61 from .fn_time import *
62 from .txtime_bursts_tagger import *
63 from .arfcn import *
64 from .device import *
65except ImportError as e:
66 import traceback; traceback.print_exc()
67 raise