1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
7 __author__
= 'Michal Čihař'
8 __email__
= 'michal@cihar.com'
10 Copyright © 2003 - 2008 Michal Čihař
12 This program is free software; you can redistribute it and/or modify it
13 under the terms of the GNU General Public License version 2 as published by
14 the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 if Wammu
.gammu_error
== None:
35 # set later in Wammu.Main to have correct debug filename
36 DEBUG_LOG_FILENAME
= None
38 # Template for system information
40 --------------- System information ----------------
53 Returns system information in text form.
55 pyver
= sys
.version
.split()[0]
56 wxver
= wx
.VERSION_STRING
57 wammuver
= Wammu
.__version
__
59 (gammuver
, pgammuver
) = gammu
.Version()
62 (gammuver
, pgammuver
, ignore
) = gammu
.Version()
64 (gammuver
, pgammuver
) = ('Unknown', 'Unknown')
65 (loc
, charset
) = locale
.getdefaultlocale()
73 result
= SYSTEM_TEMPLATE
% (
84 if Wammu
.configuration
is not None:
85 section
= Wammu
.configuration
.ReadInt('/Gammu/Section')
86 config
= Wammu
.configuration
.gammu
.GetConfig(section
)
87 result
+= 'connection %s\n' % config
['Connection']
88 result
+= 'device %s\n' % config
['Device']
89 result
+= 'model %s\n' % config
['Model']
92 def SaveLog(outf
= None, filename
= None):
94 Saves debug log to filename or handle. If none specified
96 if DEBUG_LOG_FILENAME
is None:
100 handle
, name
= tempfile
.mkstemp('.log', 'wammu-crash-')
101 outf
= os
.fdopen(handle
, 'w+')
104 outf
= open(filename
, 'w+')
106 inf
= open(DEBUG_LOG_FILENAME
, 'r')
107 outf
.write(GetSystemInfo())
108 outf
.write(inf
.read())
110 if filename
is not None: