1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
5 Phone information reader
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
27 if Wammu
.gammu_error
== None:
30 class GetInfo(Wammu
.Thread
.Thread
):
43 Manufacturer
= self
.sm
.GetManufacturer()
44 data
.append({'Name': _('Manufacturer'), 'Value': Manufacturer
, 'Synced': True})
45 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
47 except gammu
.GSMError
, val
:
48 self
.ShowError(val
[0])
54 self
.ShowProgress(1*100/progress
)
56 Model
= self
.sm
.GetModel()
57 data
.append({'Name': _('Model (Gammu identification)'), 'Value': Model
[0], 'Synced': True})
58 data
.append({'Name': _('Model (real)'), 'Value': Model
[1], 'Synced': True})
59 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
61 except gammu
.GSMError
, val
:
62 self
.ShowError(val
[0])
68 self
.ShowProgress(2*100/progress
)
70 Firmware
= self
.sm
.GetFirmware()
71 data
.append({'Name': _('Firmware'), 'Value': Firmware
[0], 'Synced': True})
73 data
.append({'Name': _('Firmware date'), 'Value': Firmware
[1], 'Synced': True})
74 if Firmware
[2] != 0.0:
75 data
.append({'Name': _('Firmware (numeric)'), 'Value': str(Firmware
[2]), 'Synced': True})
76 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
78 except gammu
.GSMError
, val
:
79 self
.ShowError(val
[0])
85 self
.ShowProgress(3*100/progress
)
87 IMEI
= self
.sm
.GetIMEI()
88 data
.append({'Name': _('Serial number (IMEI)'), 'Value': IMEI
, 'Synced': True})
89 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
91 except gammu
.GSMError
, val
:
92 self
.ShowError(val
[0])
98 self
.ShowProgress(4*100/progress
)
100 OriginalIMEI
= self
.sm
.GetOriginalIMEI()
101 data
.append({'Name': _('Original IMEI'), 'Value': OriginalIMEI
, 'Synced': True})
102 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
104 except gammu
.GSMError
, val
:
105 self
.ShowError(val
[0])
111 self
.ShowProgress(5*100/progress
)
113 ProductCode
= self
.sm
.GetProductCode()
114 data
.append({'Name': _('Product code'), 'Value': ProductCode
, 'Synced': True})
115 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
117 except gammu
.GSMError
, val
:
118 self
.ShowError(val
[0])
124 self
.ShowProgress(6*100/progress
)
126 SIMIMSI
= self
.sm
.GetSIMIMSI()
127 data
.append({'Name': _('SIM IMSI'), 'Value': SIMIMSI
, 'Synced': True})
128 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
130 except gammu
.GSMError
, val
:
131 self
.ShowError(val
[0])
137 self
.ShowProgress(7*100/progress
)
139 SMSC
= self
.sm
.GetSMSC()
140 data
.append({'Name': _('SMSC'), 'Value': SMSC
['Number'], 'Synced': True})
141 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
143 except gammu
.GSMError
, val
:
144 self
.ShowError(val
[0])
150 self
.ShowProgress(8*100/progress
)
152 info
= self
.sm
.GetHardware()
153 data
.append({'Name': _('Hardware'), 'Value': info
, 'Synced': True})
154 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
156 except gammu
.GSMError
, val
:
157 self
.ShowError(val
[0])
163 self
.ShowProgress(9*100/progress
)
165 info
= self
.sm
.GetManufactureMonth()
166 data
.append({'Name': _('Manufacture month'), 'Value': info
, 'Synced': True})
167 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
169 except gammu
.GSMError
, val
:
170 self
.ShowError(val
[0])
176 self
.ShowProgress(10*100/progress
)
178 info
= self
.sm
.GetPPM()
179 data
.append({'Name': _('Language packs in phone'), 'Value': info
, 'Synced': True})
180 except (gammu
.ERR_NOTSUPPORTED
, gammu
.ERR_NOTIMPLEMENTED
):
182 except gammu
.GSMError
, val
:
183 self
.ShowError(val
[0])
189 self
.ShowProgress(100)
190 self
.SendData(['info','phone'], data
)