ctools  2.1.0.dev
 All Classes Namespaces Files Functions Variables Macros Pages
__init__.py
Go to the documentation of this file.
1 # ==========================================================================
2 # ctools Python module
3 #
4 # Copyright (C) 2015-2021 Juergen Knoedlseder
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #
19 # ==========================================================================
20 # import gammalib first
21 import gammalib
22 
23 # Make sur that library symbols are exported by setting the dynamic library
24 # loading flag to RTLD_GLOBAL | RTLD_NOW. This is necessary on some systems.
25 import sys
26 flags = sys.getdlopenflags()
27 sys.setdlopenflags(256 | 2)
28 
29 # Import sub modules
30 from tools import *
31 
32 # Reset original flags
33 sys.setdlopenflags(flags)
34 
35 # Remove swig register stuff
36 bad_entries = [entry for entry in list(locals())
37  if entry.endswith('_swigregister')]
38 if len(bad_entries) > 0:
39  for entry in bad_entries:
40  del locals()[entry]
41 
42 # Clean-up
43 del tools
44 del gammalib
45 del bad_entries
46 #del entry
47 
48 # Add version
49 __version__ = '2.1.0.dev'