
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
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.
9 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 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
anthon38
9 years ago
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
melongex
9 years ago
Report
sconosciuto
9 years ago
Anyway I suggested to fix the plasmoid without changing locale because in this way the user will see the date in his language.
Report
melongex
9 years ago
Report
melongex
9 years ago
thanks again
Report
sconosciuto
9 years ago
I couldn't reproduce the same behavior with other plasmoids, like opendesktop_activities.
Report
melongex
9 years ago
Report
SWaN
9 years ago
Report
SWaN
9 years ago
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
sconosciuto
9 years ago
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
9 years ago
locale.getdefaultlocale() gives ('it_IT', 'UTF-8'). KDE version is 4.7.1.
Report
sconosciuto
9 years ago
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
9 years ago
Report
SWaN
9 years ago
import locale
locale.setlocale(6, 'en_US')
Report
SWaN
9 years ago
So, maybe the problem resides in Qt or KDE Python bindings. Just guessing...
Report
sconosciuto
9 years ago
Thanks anyway.
Report
sconosciuto
9 years ago
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
melongex
9 years ago
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
melongex
9 years ago
Report
einar77
9 years ago
Report
melongex
9 years ago
Report