Menu

#2 Python syntax error causes problems for Linksys

open
nobody
None
5
2006-07-07
2006-07-07
Tom Epperly
No

To make a Python tuple with only one element, you must
put a trailing comma; otherwise, the parenthesis are
treated like parenthesis.

Thus,
('Internet IP Address:') evaluates to simply
'Internet IP Address:', and the for loop searches for
'I', 'n', 't', etc.

('Internet IP Address:', ) evaluates to a tuple with
one string element.

http://docs.python.org/ref/exprlists.html

Tom

> diff -u zoneclient.py.orig zoneclient.py
--- zoneclient.py.orig 2006-07-06 20:12:11.000000000 -0700
+++ zoneclient.py 2006-07-06 20:37:27.000000000 -0700
@@ -571,17 +571,22 @@

{'router':'RT31P2',
'page':'/RouterStatus.htm',
- 'markers':('Internet IP Address:')
+ 'markers':('Internet IP Address:', )
},

{'router':'WRT54GL',
'page':'/Status_Router.asp',
- 'markers':('Internet IP')
+ 'markers':('Internet IP', )
+ },
+
+ {'router' : 'WRT54GS',
+ 'page' : '/Status_Router.asp',
+ 'markers':('Capture(share.ipaddr)', )
},

{'router':'unknown',
'page':'/Status_Router.htm',
- 'markers':('Internet IP')
+ 'markers':('Internet IP', )
}
)

faerun:~>

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.