You are not logged in.

#1 2010-10-12 01:58:22

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

[Solved] conkyForecast SyntaxError: invalid syntax

I am having issues with conkyForecast.   It no longer displays the weather.

I have had this working for quite a long time, then after an update a week or so ago it stopped working.

When I start conky manually I get the following output:

8:37PM % Conky: forked to background, pid is 14563                             ~ (knute) pts/0

Conky: desktop window (15a) is root window
Conky: window type - desktop
Conky: drawing to created window (0x1000001)
Conky: drawing to double buffer
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
 8:37PM %                                                                       ~ (knute) pts/0

I think that it's repeated so many times because I have multiple copies of the conky template running.
I have 2 templates actually.  Here they are:

# weather template
template7 ${execi 3600 conkyForecast --location=USND0115 -i -d \1}
template8 ${execi 3600 conkyForecast --location=USND0115 -i -n -d \1}

Then, in my text I just use:

${template7 CN}

to display the item.

I am currently using:

  • conky-new 1.8.0_rc2-3

  • conkyforecast-bzr 47-1

I'm not sure what other info you need, but I'm stumped.
I have tried uninstalling and reinstalling conkyforecast, both the bzr version and the regular one.  No luck.

I have waited for so long before asking for help, because I was thinking that it may be something to do with the new version of python that's out, but so far, it's not migrating.  I did find the option of changing the shebang from /usr/bin/python to /usr/bin/python2, but that changed nothing.

Any other suggestions?

Last edited by Knute (2010-10-20 12:34:23)


Knute

Offline

#2 2010-10-16 16:03:41

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Alright, today I played with not only conkyForecast, but also conkyemail, and conkygooglecalendar.

They are all acting the same way.  It's like they are not accepting the inputs from the scripts.

When I put in the xoap address from conkyforecast with my location info,  I got the xml returned in firefox with the information.  So it would appear that conky is not accepting the switches and such.

I haven't really looked at conky's code all that much, so I'm not really sure how to proceed on this.


Knute

Offline

#3 2010-10-16 16:28:53

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Are you using testing?


Website - Blog - arch-home
Arch User since March 2005

Offline

#4 2010-10-16 16:29:21

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Does it work correctly if you don't use a template?  For example, if you replace

${template7 CN}

with

${execi 3600 conkyForecast --location=USND0115 -i -d CN}

in your rc file?  Sometimes templates need to be evalated more than once. 

Have you tried conky 1.8.1 yet?

Offline

#5 2010-10-16 17:21:45

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [Solved] conkyForecast SyntaxError: invalid syntax

I tried using both the example and the testing routines, after killing my conky.

No location info was shown.

I have set up to use both the template and the full command.  Neither one shows the information.

And yes, I am using the testing repo, so I have python 3.1.

P.S.   Just installed the conky package (1.8.1) and tried it.  No change.

Last edited by Knute (2010-10-16 17:34:35)


Knute

Offline

#6 2010-10-16 17:22:17

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [Solved] conkyForecast SyntaxError: invalid syntax

I second pyther's question, are you using testing? From the error message, I'd say you are, which means you've updated to python 3, and conkyForecast is not compatible with that. Install python2, and change the first line in conkyForecast.py from #!/usr/bin/python to #!/usr/bin/python2

Offline

#7 2010-10-16 17:36:13

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Just tried that change in conkyForecast.py, and restarted conky.  The same thing happened, with the same error message.


Knute

Offline

#8 2010-10-16 18:35:38

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Oh yeah. Modify /usr/bin/conkyForecast, change /usr/bin/python in it to /usr/bin/python2

Offline

#9 2010-10-16 18:54:31

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Been there, done that, no change.

 1:51PM % grep /usr/bin /usr/share/conkyforecast/conkyForecast.py               ~ (knute) pts/0
#!/usr/bin/python2
 1:51PM % pkill conky                                                           ~ (knute) pts/0
Hunting conky...
conky Terminated!
 1:51PM % conky &!                                                              ~ (knute) pts/0
 1:51PM % Conky: forked to background, pid is 3306                              ~ (knute) pts/0

Conky: desktop window (15a) is root window
Conky: window type - desktop
Conky: drawing to created window (0x1c00001)
Conky: drawing to double buffer
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="USND0115", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax
  File "/usr/share/conkyforecast/conkyForecast.py", line 50
    self.parser.add_option("-l", "--location", dest="location", default="USND0115", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
                                                                                                                                                                                                                                                                                                    ^
SyntaxError: invalid syntax

Hrmmmm... The carat isn't showing up.

There's a ^ in the line above the SyntaxError above the a.

Last edited by Knute (2010-10-16 18:56:09)


Knute

Offline

#10 2010-10-20 10:57:30

futuremonkey
Member
Registered: 2009-02-28
Posts: 49

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Any progress on this?  I have the same problem, and FWIW I'm not using testing.

Offline

#11 2010-10-20 11:24:56

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved] conkyForecast SyntaxError: invalid syntax

Python 3 has been moved to [extra] since a few days, as has python2. You'll need to edit both the script in /usr/bin and /usr/share/conkyForecast/. You'd think just editing the script in /usr/bin would solve it, but no tongue.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#12 2010-10-20 12:33:22

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [Solved] conkyForecast SyntaxError: invalid syntax

That did it.  I wasn't aware that conkyForecast put anything in /usr/bin.

Thanks.  Marking this one solved.  smile


Knute

Offline

Board footer

Powered by FluxBB