syntax error in pystromo-remap.py

Asked by navitron3000

when I try to run the pystromo-remap.py script using:

cd /home/username/.config/pystromo
./pystromo-remap.py -m default.map

I get the following error:

 File "./pystromo-remap.py", line 173
    busyDevices = list (device for device in inputs if device.busy)
                                 ^
SyntaxError: invalid syntax

any ideas? my n52 outputs it's defaults without any problems but I can't get the remapping script to run. I'm running a custom OS called Filmlight OS based on the 2.6 kernel but I think the script should still run.

Question information

Language:
English Edit question
Status:
Answered
For:
Pystromo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Raumkraut (raumkraut) said :
#1

What version of python are you running (`python --version`)?
That particular syntax was added in Python 2.4 (circa 2004!) AFAIK.

Revision history for this message
navitron3000 (navitron3000) said :
#2

AH! I am running 2.3.4 Why such an old version I'm not sure but that
could be my problem. thanks for the quick reply.

brandon

On May 14, 2009, at 12:27 PM, Raumkraut wrote:

> Your question #71148 on Pystromo changed:
> https://answers.launchpad.net/pystromo/+question/71148
>
> Status: Open => Needs information
>
> Raumkraut requested for more information:
> What version of python are you running (`python --version`)?
> That particular syntax was added in Python 2.4 (circa 2004!) AFAIK.
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
> https://answers.launchpad.net/pystromo/+question/71148
>
> You received this question notification because you are a direct
> subscriber of the question.

Revision history for this message
Raumkraut (raumkraut) said :
#3

In fact, that particular line could (possibly should) be changed to the following, which should itself work in any Python from 2.0:
busyDevices = [device for device in inputs if device.busy]

Any other occurrences can probably be gotten around, for pre-2.4 Python, by putting square brackets ("[]") inside the normal parentheses ("()"). E.g.:
blah = blah ( [ blah for blah in blah if blah ] )

Can you help with this problem?

Provide an answer of your own, or ask navitron3000 for more information if necessary.

To post a message you must log in.