drewcrawford / Phone-Pipe

97 stars 4 forks source link

wrong syntax at line : 77 #5

Closed labrouss closed 13 years ago

labrouss commented 13 years ago

Wrong syntax at line 77, quotes should change the following fixes the issue ;-)

was

"uri": url if url is not None else ""

changed to

"uri": "url if url is not None else "

anyways, thanks for the nice tool

drewcrawford commented 13 years ago

I just tested the version at https://github.com/drewcrawford/Phone-Pipe/blob/master/phone and I'm not getting a syntax error with the following incantation:

python phone --url=http://www.google.com

Can you reply with a stack trace?

labrouss commented 13 years ago

the error i'm getting when running python ./phone is:

File "./phone", line 77 "uri": url if url is not None else "" ^ SyntaxError: invalid syntax

don't know how to get a python stack trace any hints ?

labrouss commented 13 years ago

Ah forgot to say that i've got Python 2.4.3 installed on my CentOS linux

drewcrawford commented 13 years ago

That line uses new syntax introduced with Python 2.5. See http://docs.python.org/whatsnew/2.5.html

labrouss commented 13 years ago

thanks for the reference, the change does the trick for me do you think i'll have any issue with that ?

drewcrawford commented 13 years ago

I would roll back that statement to this version:

https://github.com/drewcrawford/Phone-Pipe/commit/875ef128435ddd05f0f251883277768e34a11928

data = {"title":title,"msg":msg,"label":label,"uri":url==None and "" or url}