Airdate

Plasma 4 Widgets

Source (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
Score 75.5%
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:

8 years ago

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

9

anthon38

8 years ago

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!

Report

C

melongex

8 years ago

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

Report

9

sconosciuto

8 years ago

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.

Report

C

melongex

8 years ago

I see your point and changed that part.

Report

C

melongex

8 years ago

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

Report

9

sconosciuto

8 years ago

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.

Report

C

melongex

8 years ago

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

Report

SWaN

8 years ago

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

Report

SWaN

8 years ago

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 ;)

Report

9

sconosciuto

8 years ago

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

Report

SWaN

8 years ago

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.

Report

9

sconosciuto

8 years ago

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)

Report

SWaN

8 years ago

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

Report

SWaN

8 years ago

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

Report

SWaN

8 years ago

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

Report

9

sconosciuto

8 years ago

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

Report

9

sconosciuto

8 years ago

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

Report

C

melongex

8 years ago

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)

Report

C

melongex

8 years ago

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

Report

einar77

8 years ago

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

Report

C

melongex

8 years ago

didn't know that, thanks for the suggestion

Report

8 years ago

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

12345678910
7
product-maker pars1938 Dec 17 2011 9 excellent
product-maker tcahill Nov 26 2011 9 excellent
product-maker levondavdyan Oct 11 2011 9 excellent
product-maker Sonnenwolf Oct 07 2011 9 excellent
product-maker anthon38 Oct 05 2011 9 excellent
product-maker sconosciuto Sep 22 2011 9 excellent
product-maker zubi Sep 22 2011 9 excellent
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.24
updated Oct 10 2011
added Sep 21 2011
downloads 24h
0
mediaviews 24h 0
pageviews 24h 3