default.py needing some mods
#16
as the wise man already said:
(2013-05-28, 22:34)amet Wrote: lets see the XBMC debug log once this happens, it will have a clues in there why it bombed out.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#17
(2013-05-29, 01:06)pan2 Wrote: I did put it in but still error

We need to see that error log. With that we can tell what's going on
Reply
#18
http://xbmclogs.com/show.php?id=22884
Reply
#19
you've got an indenting error:
Code:
Error Contents: ('unexpected indent', ('C:\\Users\\Paul\\AppData\\Roaming\\XBMC\\addons\\weather.ozweather\\default.py', 88, 3, "\t\t\tsetProperty(WEATHER_WINDOW, 'Daily.%i.ShortDate' % count)\n"))

use spaces, not tabs for indenting.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#20
aha! that's all it was. I've got a lot to learn about python obviously. Thanks guys, much appreciated
Reply
#21
Is that the only date structure you wanted?

Change %A to %a to get the shorter day name.

The code I wrote should be in a function instead of uglying up B808's good work.

Take the guts of my hacked code and put it in a new function somewhere earlier in the module:
Code:
def date_format(count):
    tdate = datetime.date.today() #establishes current date
    futureDate = tdate + datetime.timedelta(days=count) #establishs the future dates one at a time
    newdatetuple = time.strptime(str(futureDate),'%Y-%m-%d')#creates a time tuple of that future date
    goodshortDate = time.strftime('%A %d %b', newdatetuple) #sets the format of the time tuple, taken from this table http://tinyurl.com/cbxbv7v
    return goodshortDate

And then replace this:
Code:
setProperty(WEATHER_WINDOW, 'Daily.%i.ShortDate' % count, goodshortDate)
with this:
Code:
setProperty(WEATHER_WINDOW, 'Daily.%i.ShortDate' % count, date_format(count))
Reply
#22
Yes it is the only date structure I want. I have taken your advice and tidied up the file. It works well. I'll try to contact Bossanove808 about the changes to this and the MyWeather xml. He has been happy to acknowledge changes I made to the xml before but this time you guys get the credit. Python seems to be a bit of a challenge with little things like indents causing so much difficulty but I will keep learning. Thanks once again to you and Ronie.
ps. I've noticed that inclusion of dates in the weather page can present some appearance problems with spacing so I changed to a monotype font. Looks much better
Reply
#23
No problem.

I wouldnt be averse to the idea of a +1 to get me off the mark in the reputation stakes. Blush
Reply
#24
My pleasure, you have been a great help
Reply

Logout Mark Read Team Forum Stats Members Help
default.py needing some mods0