1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
4 Phone communication libary - python wrapper for Gammu library.
6 __author__
= 'Michal Čihař'
7 __email__
= 'michal@cihar.com'
9 Copyright © 2003 - 2010 Michal Čihař
11 This program is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License version 2 as published by
13 the Free Software Foundation.
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20 You should have received a copy of the GNU General Public License along with
21 this program; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 # Import core library, we need to load it into global namespace
34 # as otherwise libdbi plugins fail to find some symbols
36 if not hasattr(sys
,'getdlopenflags'):
37 from gammu
._gammu
import *
40 from dl
import RTLD_GLOBAL
, RTLD_NOW
46 osname
= os
.uname()[0]
47 if osname
== 'Linux' or osname
== 'SunOS':
50 elif osname
== 'Darwin':
56 if RTLD_GLOBAL
!= -1 and RTLD_NOW
!= -1:
58 flags
= sys
.getdlopenflags()
59 sys
.setdlopenflags(RTLD_GLOBAL | RTLD_NOW
)
61 from gammu
._gammu
import *
63 sys
.setdlopenflags(flags
)
65 from gammu
._gammu
import *
67 from gammu
._gammu
import *
71 __version__
= 'Gammu %s, python-gammu %s' % (