RE: Update to LG Phones
Simon C <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <[email protected]> |
> 4400 caused an
> >exception.
>
> Please post the exception. There's a reason I have
> debugging statements in the code.
Here it is.
An unexpected exception has occurred.
Please see the help for details on what to do.
Traceback (most recent call last):
File "C:\projects\bitpim\gui.py", line 173, in run
res=call()
File "C:\projects\bitpim\gui.py", line 113, in
__call__
return apply(self.method, self.args+args, d)
File "C:\projects\bitpim\gui.py", line 1735, in
detectphone
return
phone_detect.DetectPhone(self).detect(using_port)
File "C:\projects\bitpim\phone_detect.py", line 217,
in detect
module)
File "C:\projects\bitpim\com_lgvx4400.py", line
1039, in detectphone
p.eval_detect_data(res[port])
File "C:\projects\bitpim\com_lgvx4400.py", line
1008, in eval_detect_data
if res.get(self.brew_version_txt_key,
'')[:len(self.my_model)]==self.my_model or \
TypeError: unsubscriptable object
Variables by last 8 frames, innermost last
Frame __bootstrap in c:\python23\lib\threading.py at
line 442
self = <WorkerThread(BitPim helper,
started daemon)>
Frame run in C:\projects\bitpim\gui.py at line 166
e = <exceptions.TypeError instance at
0x0314D120>
res = None
self = <WorkerThread(BitPim helper,
started daemon)>
item = (<gui.Request instance at
0x020C8738>, <gui.Callback instance at 0x0211CA80>)
call = <gui.Request instance at
0x020C8738>
ex = <exceptions.TypeError instance at
0x0314D120>
resultcb = <gui.Callback instance at
0x0211CA80>
first = 0
Frame __call__ in C:\projects\bitpim\gui.py at line
113
self = <gui.Request instance at
0x020C8738>
args = ()
d = Keys []
{}
kwargs = Keys []
{}
Frame detectphone in C:\projects\bitpim\gui.py at line
1735
self = <WorkerThread(BitPim helper,
started daemon)>
using_port = 'COM7'
Frame detect in C:\projects\bitpim\phone_detect.py at
line 217
models = ['Audiovox CDM-8900', 'LG-TM520',
'LG-VX10', 'LG-VX3200', 'LG-VX4400', 'LG-VX450
using_port = 'COM7'
coms = [{'available': True, 'driverdate':
(2001, 7, 1), 'description': 'Communications
found_port = None
threads = []
likely_ports = ['COM7']
found_model = None
x = Keys ['active', 'available',
'class', 'description', 'driverdate',
'driverdescription', 'driverprovider',
'driverversion', 'hardwareinstance', 'name']
{'available': False, 'driverdate':
(2004, 8, 3), 'description': 'Standard Modem
model = 'LG-VX4400'
pm = Keys ['Audiovox CDM-8900',
'LG-TM520', 'LG-VX10', 'LG-VX3200', 'LG-VX4400',
'LG-VX4500', 'LG-VX4600 (Telus Mobility)', 'LG-VX4650
(VZW)', 'LG-VX6000', 'LG-VX6100', 'LG-VX7000',
'LG-VX8000 (Verizon Wireless)', 'LG-VX8100 (Verizon
Wireless)', 'MM-7400', 'Other CDMA phone', 'PM-8200',
'RL-4920', 'SCH-A310', 'SCH-A650', 'SCH-A670',
'SCP-4900', 'SCP-5300', 'SCP-5400', 'SCP-5500',
'SCP-7200', 'SCP-7300', 'SCP-8100', 'SCP-8100 (Bell
Mobility)', 'SK6100 (Pelephone)', 'SPH-A460',
'SPH-A620 (VGA1000)']
{'LG-VX3200': 'com_lgvx3200',
'SCP-7200': 'com_sanyo7200', 'SCP-4900': 'com_sany
available_coms = ['COM7']
self = <phone_detect.DetectPhone object at
0x020E5950>
available_modem_coms = []
Frame detectphone in
C:\projects\bitpim\com_lgvx4400.py at line 1043
res = Keys ['COM7']
{'COM7': {'mode_modem': None,
'esn_file': '\xff\xff\xff\xff\xff\xff\xff\xff\xff\
coms = [{'available': True, 'driverdate':
(2001, 7, 1), 'description': 'Communications
p = <com_lgvx4400.Phone instance at
0x0211CB48>
likely_ports = ['COM7']
port = 'COM7'
Frame eval_detect_data in
C:\projects\bitpim\com_lgvx4400.py at line 1008
res = Keys ['brew_version.txt', 'esn',
'esn_file', 'firmware_version', 'firmwareresponse',
'lgpbinfo', 'manufacturer', 'mode_brew', 'mode_modem',
'model']
{'mode_modem': None, 'esn_file':
'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x
self = <com_lgvx4400.Phone instance at
0x0211CB48>
> >Also some data is stored in the res passed to
> detect_phone and that
> >is persistant from one model to the next as all the
> phone models are
> >called, this causes problems, I changed the info to
> not be
> >persistant.
>
> That was by design. The idea is to initially read
> as much info as possible and share that info with
> other phone codes. Please elaborate on the problems
> that this caused you.
I did not debug into it in great detail, but when I
changed the info to be reevaluated for each model the
problem went away, however I also changed the
algorithm to use the version file if present at the
same time and ignore the other information so it may
be that this does not really make a difference.
The critical change was in eval_detect_data(self,
res):
Changing :
if res.get(self.brew_version_txt_key,
'')[:len(self.my_model)]==self.my_model or \
res.get(self.lgpbinfo_key,
'').find(self.my_model)!=-1:
To:
version=phone_info.get(self.brew_version_txt_key, '')
if (version!=None and
version[:len(self.my_model)]==self.my_model) or \
(version==None and
phone_info.get(self.lgpbinfo_key,
'').find(self.my_model)!=-1):
Got rid of the exception and stopped the 6100 showing
up as a 6000.
From a design perspective, keeping the data
persistant means that the name of the version file
must be the same for all LG models.
> >Also if the version file is present it should be
> the only thing used
> >to match the phone, the other check for phones
> without the version
> >file caused the 6100 to be detected as a 6000!, not
> sure why.
>
> Do both 6000 and 6100 have version files? I need
> more data to evaluate this.
I do not know about the 6000, but the 6100 does have
the version file. The 6100 version file contains
"VX6100", the other test using the lgpbinfo_key did
return 'vx6000' in the string from the phone, a bug
probably as it really is a 6100, changing the code to
only use the version file if present gets around the
bug in the phone.
If you want me to do any more testing I have access to
the 6100 again.
Simon
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf