Losungen

Plasma 4 Extensions

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

9
Score 73.0%
Description:

There has been an issue with the character encoding of the date. It should be fixed now, but I couldn't test it myself, since the python bindings for KDE 4.4.1 are still missing in Debian.

Requires KDE > 4.3!

Plasma widget for the daily text (bible verse) selected by the Moravian Church (Herrnhuter Brüdergemeinde). Unfortunately, the widget does not contain an English translation of the bible verses due to copyright issues. Requires python script-engine.

Plasma widget für die (tägliche) Losung der Herrnhuter Brüdergemeinde an. Benötigt die python script-engine.

I started this widget as an exercise for learning the plasma API. I'm not sure if it is of any use for anybody - especially since I cannot provide an English translation of the verses - but don't hesitate to contact me, if you have any suggestions for improvement.
Last changelog:

9 years ago

0.3.3 2011-01-23
[indent]* Added texts for 2011[/indent]
0.3.2 2010-03-15
[indent]* Fixed character encoding issue with strftime (Thanks to Philipp Hahn)[/indent]
0.3.1 2009-11-09
[indent]* Added error message for the case that losungen texts are missing.[/indent]
0.3 2009-11-09
[indent]* Added texts for 2010 and adapted parser to new column ordering.
* Applied patch from Ruthard Baudach with minor modifications; replaces "/" and "#" into HTML format tags.[/indent]
0.2.1
[indent]* Fixed persistence of configuration parameters.[/indent]
0.2
[indent]* Added configuration dialog for font size and "Bible URL".
* Fixed encoding issue in the info dialog.[/indent]
0.1.1 Bugfix release.
[indent]* Fixed encoding issue.
* Fixed CSS template.[/indent]
0.1 Initial release.

DrM

10 years ago

After reboot the Losungen plasmoid is not working and a 'script failure' message appears instead of the plasmoid...
I cant even reload it from KDE-look.org
via the add widget tool (miniprogramm hinzufügen). I recently updadet to KDE 4.3.5 but the Losungen plasmoid continued working excellent - but yesterdays -out of the blue - it stops working ....any ideas?
I liked this plasmoid very much. And would love to have it up and running again.

System opensuse 11.2 KDE 4.3.5

Report

C

jwchile

10 years ago

Did you check, whether your system got updated to KDE 4.4? I got a few reports that the plasmoid crashes with the new KDE release. I will fix it when Debian is updating to KDE 4.4, which should be in the next few days.

Johannes

Report

DrM

10 years ago

Hi

Its still KDE 4.3.5
however I need to check if there has been an recent update for phyton or the pending libaries installed via Yast ... I tried other python based plasmoid and these didn't work either .. others do ...
I still do not have a clue?
Eventually I need do downgrad to a previous python version ?


opensuse 11.2 (32) KDE 4.3.5

Report

C

jwchile

10 years ago

KDE 4.3.5 won't be released in Debian at all, so I can't test it myself. Could you start the plasmoid in a shell with the following command and tell me what output you get?

plasmoidviewer -c desktop losungen

Johannes

Report

danny-ger

10 years ago

I have the same problem since the same day as DrM. The output of the console says:

plasmoidviewer -c desktop losungen
10
Traceback (most recent call last):
File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 55, in init
self.pyapplet.init()
File "/home/dan/.kde/share/apps/plasma/plasmoids/losungen/contents/code/main.py", line 185, in init
self.loadLosung()
File "/home/dan/.kde/share/apps/plasma/plasmoids/losungen/contents/code/main.py", line 102, in loadLosung
self.contentWidget.setText(self.r.renderLosung(losung, self.currentDate))
File "/home/dan/.kde/share/apps/plasma/plasmoids/losungen/contents/code/render.py", line 97, in renderLosung
return buf.getvalue()
File "/usr/lib/python2.6/StringIO.py", line 270, in getvalue
self.buf += ''.join(self.buflist)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 22: ordinal not in range(128)
TypeError: invalid result type from PythonAppletScript.shape()

Report

rasch

10 years ago

Unfortunately I came across this plasmoid only after it ceased to work on OpenSuse 11.2...
As I have virtually no knowledge about python I was only able to deduce the source of the problem, hope this helps others to fix it.
The problem goes away if you change Line 88 in render.py to:

buf.write("""<p class="title">Date</p>""")

So the reason is the umlaut in month march ('März' in german) that gets rendered into this tag.
With this change it works, but you have not the current date displayed in its window.

Regards
rasch

Report

rasch

10 years ago

Today I had a chance to check your fix and it works like a charm!
Thank you very much!

rasch

Report

C

jwchile

10 years ago

Thanks for the hint. I think I fixed the character encoding issue in 0.3.2, but I couldn't test it myself. If there's still a problem please let me know.

Johannes

Report

danny-ger

10 years ago

Ups - klicked the wrong link. I just posted the solution to the problem under the subject "The solution". Just to let you know via eMail-Reminder...

Report

justi

10 years ago

Nice little plasmoid.
thank you

Report

rjgvb

10 years ago

More than 50 downloads in two month show that your work is of use to others. Installing it I've got the Error message "Skript-Initialisierung fehlgeschlagen" (Yes - most users of Losungen will use German as default language;-)
Analyzing this as far as I could I found line 95 in main.py trying to instantiate PyKDE4.plasma.Plasma.TextBrowser. My Python 2.6 PyKDE4.plasma.Plasma module (on Kubuntu 09.04) does not contain a class TextBrowser. Any idea how to work around this?

I've been hacking quite a while on a wxPython Losungen reader for personal use, and for me using the xml Losungen source and the python xml module to parse appeared to be a bit faster than using csv.

Perhaps I did not recognize it in your code - but did you implement a download for next years Losungen file? Otherwise your widget might have a sort of Jan 1st problem.

The idea is great, your code is well organized - I wish I could use your widget:-(

God bless you and your work.

Report

C

jwchile

10 years ago

Thanks for the feedback!

> trying to instantiate PyKDE4.plasma.Plasma.TextBrowser
PyKDE4.plasma.Plasma.TextBrowser is part of (py)KDE since 4.3 and (K)Ubuntu 9.04 ships 4.2 (see http://api.kde.org/4.x-api/kdelibs-apidocs/plasma/html/classPlasma_1_1TextBrowser.html).
So you can either install KDE 4.3 packages for Jaunty which lack official support, or you wait for the Karmic release (which is supposed to be in 3 days).

> download for next years Losungen file
I did not implement it. So far I just planned to make a release with the new data.

> xml module [...] appeared to be a bit faster than using csv
I wouldn't expect much of a difference. And in case there is one, CSV should be faster since it only has to count newlines and split up one line, isn't it?

Cheers,
Johannes

Report

rjgvb

10 years ago

Thanks for the hint with 9.10 - works fine by now. I had a look on your code - as you are not checking the date, but assume that the losung of the day will be found in line day-of-year + 1, csv will be faster than xml parsing. The drawback is that you will get the same losung for everyday in history regardless of the year, and will get problems some year as Losungen.de may change their csv dialect (O yes - they did already do this!)

It's very time consuming to search the csv file line by line checking every line for the date until the correct date is found, xml will take some time parsing the file on startup and get the correct data record quickly afterwards.

Your solution - counting lines till date of year + 1 is reached - should be the fastest, but I think a check for the correct year (could be done e.g. by constructing the losung file name with something like 'Losungen' + unicode(datetime.date.today().year) + '.csv' and catching the exception if the correct file is not found, showing an error message, would be nice.

Report

C

jwchile

10 years ago

You are right, I didn't check for the year yet. I added this with the texts for 2010 and your proposed error message.

Thanks for your suggestions!

Report

EinfachToll

10 years ago

Good work!
But it was cool if the font size is a bit smaller, the plasmoid takes quite much place on the desktop. And the info text would better be in Unicode ;)

Report

warnec

10 years ago

Is it not something similar (or even identical) to this?

http://kde-look.org/content/show.php/bibleVerse?content=108668

Report

C

jwchile

10 years ago

Yes, it's similar, but there are some differences. Losungen uses an offline source for the bible verses and the selection is from the Moravian Church (Herrnhuter Brüdergemeinde). In German-speaking countries this selection is well-known and quite popular.

Report

9 years ago

0.3.3 2011-01-23
[indent]* Added texts for 2011[/indent]
0.3.2 2010-03-15
[indent]* Fixed character encoding issue with strftime (Thanks to Philipp Hahn)[/indent]
0.3.1 2009-11-09
[indent]* Added error message for the case that losungen texts are missing.[/indent]
0.3 2009-11-09
[indent]* Added texts for 2010 and adapted parser to new column ordering.
* Applied patch from Ruthard Baudach with minor modifications; replaces "/" and "#" into HTML format tags.[/indent]
0.2.1
[indent]* Fixed persistence of configuration parameters.[/indent]
0.2
[indent]* Added configuration dialog for font size and "Bible URL".
* Fixed encoding issue in the info dialog.[/indent]
0.1.1 Bugfix release.
[indent]* Fixed encoding issue.
* Fixed CSS template.[/indent]
0.1 Initial release.

12345678910
313
product-maker Annisonne Jan 23 2012 9 excellent
product-maker mkretz Jan 02 2012 9 excellent
product-maker Hanau2010 Sep 18 2011 9 excellent
product-maker cptG Jul 25 2011 9 excellent
product-maker mmj May 31 2011 9 excellent
product-maker SlyderBY May 31 2011 9 excellent
product-maker Brutus180 Apr 25 2011 9 excellent
product-maker Infosoft Apr 04 2011 9 excellent
product-maker gendzis Feb 21 2011 9 excellent
product-maker AlexeyDanilovich Feb 19 2011 9 excellent
product-maker matejv Feb 06 2011 9 excellent
product-maker evergreenpsyche Jan 31 2011 9 excellent
product-maker mgp Jan 28 2011 9 excellent
product-maker DrNop Jan 24 2011 3 bad
product-maker juank202 Jan 23 2011 3 bad
product-maker AlmaTlust Jan 03 2011 3 bad
product-maker Base: 4 x 5.0 Ratings
bodiro
Dec 21 2015
mmj
Dec 04 2012
Annisonne
Jan 23 2012
mkretz
Jan 05 2011
AlmaTlust
Jun 11 2010
bulldog98
Mar 04 2010
DrM
Mar 02 2010
justi
Nov 10 2009
EinfachToll
Sep 02 2009
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.3.3
updated Jan 23 2011
added Aug 31 2009
downloads 24h
0
mediaviews 24h 0
pageviews 24h 1