Geal / PilotSSH-scripts

A collection of scripts usable with the PilotSSH iOS app
http://pilotssh.com
MIT License
52 stars 14 forks source link

The "Network" script gives a parse error #20

Open jussi-kalliokoski opened 11 years ago

jussi-kalliokoski commented 11 years ago

Selecting the Network menu in the script selection screen gives me an error:

Parse error: End of input at character 0 of 

I suppose the script is giving an empty response, probably because of something missing on my platform. A more useful error message might be good.

Geal commented 11 years ago

It is an executable Python script, so you must have Python to use it (I provided scripts in different languages to show that any language is fine). It also requires the netifaces Python lib, but there should be an explicit message telling you to install it. If you already have Python and netifaces, try running the script directly from command line, and pasting the result here, that would help me fix the script.

jussi-kalliokoski commented 11 years ago

It seems that the script is using python 2 syntax, but is referring to just python as its environment, which on my system (Arch Linux) refers to python 3:

  File "network", line 5
    print '{ "version": 1, "title": "Network", "type":"status", "status":"error", "message":"Please install the netifaces Python module to use this script" }'
                                                                                                                                                             ^
SyntaxError: invalid syntax

Would be nice if pilot-ssh could on non-zero exit code and empty stdout give the stderr as the error message. :)

Geal commented 11 years ago

Ok, so maybe I should set directly the expected Python version, or make the code compatible.

Showing stderr is a very good idea, I'll create a new issue for that.