Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
7.3

Description:
A plasmoid, which is written in python, that displays when TV shows air the next time and when they aired previously.

You need the following packages to run it:
python-beautifulsoup
python-kde4
python-qt4

Install the plasmoid by calling
plasmapkg -i airdate.zip
in the folder where you placed airdate.zip

(update the plasmoid to a newer version with plasmapkg -u airdate.zip)

You can also change the source code and whatever you like by unpacking it...

Once you installed the plasmoid you can simply add it to our desktop.
Add a ty series by pressing the edit button (button on the very right), typing the showname into the editbox and finally pressing the "+" button.
Last changelog:

Oct/05/2011:
* fixed a bug that occured if the locale settings wasn't en_US (thanks to SWaN for the import locale solution)
* added the requested weekday
* changed all the stuff that anthon38 suggested, thanks!
* noticed a small bug, when adding a series that is already in the list

Oct/10/2011:
* bug fixes
* new feature: day offset


Ratings & Comments

21 Comments

anthon38

Hi, Thank you for your plasmoid, it's very useful. I have some comments about it though, I hope you don't mind ;) -I think you included the wrong main.py in the package, as it doesn't contains the import locale fix. -You should put your plasmoid in the category "plasmoid script" instead of "plasmoid binary", so that it can be downloaded directly with KGHNS, instead of having to be installed manually. -To fix the visual glitch mentioned in the comments, you can use setFlag(QGraphicsItem.ItemClipsChildrenToShape) on the scrollwidget. -Instead of shipping your own icons with the plasmoid, you can use those shipped with KDE, since the plasmoid requires Plasma to run anyway, right? ;) So instead of this: icon23 = QIcon() icon23.addPixmap(QPixmap(self.applet.package().filePath("ui","add.png")), QIcon.Normal, QIcon.Off) self.addButton.setIcon(icon23) You can do this: self.addButton.setIcon(KIcon("list-add")) -Using the "list-remove" icon would be more consistent than the "edit-delete" icon. -Same goes for "view-refresh" instead of "edit-redo". I think that's all, thanks again!

melongex

thank you very much for your comment. I changed the stuff and uploaded the new version.

melongex

btw, you may have noticed that this is my first plasmoid and I am not very familiar with qt either, so I am really happy for all comments and suggestions I can get. thanks again

sconosciuto

Thank you both! Anyway I suggested to fix the plasmoid without changing locale because in this way the user will see the date in his language.

melongex

I see your point and changed that part.

sconosciuto

I don't know if it's a KDE issue or not, but when the list is too long and a scrollbar appears, if you put a plasmoid below airdate-plasmoid you'll see the rest of the list over this one. I couldn't reproduce the same behavior with other plasmoids, like opendesktop_activities.

SWaN

I can't reproduce your issue, sorry. I'm running KDE 4.7.1.

melongex

I also noticed that this occurs sometime, but I do not know how to fix this issue as it does not appear if I simply use plasmoidviewer. I believe that this either a bug in plasma or a driver issue. what kind of graphicscard do you use? I'm using a ati 4850 with the r600 open source driver

SWaN

I get this error instead: Quote:

File "/home/xxx/.kde4/share/apps/plasma/plasmoids/airdate-plasmoid/contents/code/main.py", line 272, in fetchedInfo self.ntime = time.strptime(datestring,"%b %d %Y") File "/usr/lib/python2.7/_strptime.py", line 454, in _strptime_time return _strptime(data_string, format)[0] File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime (data_string, format)) ValueError: time data 'Sep 29 2011' does not match format '%b %d %Y'
My system's locale is it_IT, can this affect the parsing of the date? Nice and useful app, btw ;)

melongex

I guess that the output of the website that I am parsing depends on your local settings. I'll patch this as soon as possible, thanks for your comment! (could take a week as I am not at home right now)

melongex

no, you were right, it is because %b uses your locale's month name... I'll fix it soon

sconosciuto

Same problem here. However 'time.strptime("Sep 10 2011","%b %d %Y")' in the python console gives no errors. I'm using KDE 4.6.5, locales it_IT

sconosciuto

Same problem here. However 'time.strptime("Sep 10 2011","%b %d %Y")' in the python console gives no errors. I'm using KDE 4.6.5, locales it_IT

sconosciuto

Sorry for the (double) useless post. When I wrote it there was no answer, even if it was sent an hour earlier. Thanks anyway.

SWaN

Python failing parsing the %b was my first thought indeed, but you're right. I tried your code as well, and works in python console both with version 2.7.2 and 3.2.2. locale.getdefaultlocale() gives ('it_IT', 'UTF-8'). KDE version is 4.7.1.

sconosciuto

Yes, locale is the problem. I don't know why in python console works. I tried to fix it: http://pastebin.com/0kT2BL7F See lines: 264, 270 and 279 (I noticed that what is called day actually is the month)

SWaN

It works this way, thank you. So, maybe the problem resides in Qt or KDE Python bindings. Just guessing...

SWaN

A somewhat cleaner and portable solution: import locale locale.setlocale(6, 'en_US')

SWaN

BTW, it would be great if you could add the week day to the date string. It would help keeping a weekly "plan"!

einar77

BeautifulSoup's parsing is somewhat slow. I'd suggest you try lxml as an alternative (html module) which is likely faster.

melongex

didn't know that, thanks for the suggestion

Pling
0 Affiliates
Details
license
version 0.24
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

More Plasma 4 Extensions from melongex:

SABnzbp
melongex
last update date: 10 years ago

Score 5.7

dotastat
melongex
last update date: 10 years ago

Score 5.7

Gamemode
melongex
last update date: 10 years ago

Score 5.0

Other Plasma 4 Extensions:

Icon Tasks deb build
N00bun2
last update date: 13 years ago

Score 4.3

Prayer Times Plasmoid
riyad
last update date: 12 years ago

Score 5.2

KPrayertime4 Islamic Prayer Times
ahaq
last update date: 15 years ago

Score 4.4

Hostinfo
mgraesslin
last update date: 13 years ago

Score 4.7

Monitor QuadCore Russian
kuchumovn
last update date: 16 years ago

Score 5.0

blaKjaK
werevire
last update date: 15 years ago

Score 5.0