KarambaVerseOfTheDay

Karamba & Superkaramba

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
5 .0
Description:

KarambaVerseOfTheDay (c) 2003 Jan Finell
Superkaramba bible-verse-of-the-day theme.

Fetching verses from
http://votd.christ.com/biblevotd/

!Note!
Using the python textwrap module, hence it will only work with Python2.3
Last changelog:

16 years ago

0.2 - Showing the Book and the Chapter information separately.

0.3 - Fixed the regex-patterns so that it works with the changes made in the source html.

notanuseryet

11 years ago

diff -rau KarambaVerseOfTheDay/KarambaVerseOfTheDay.py modificado/KarambaVerseOfTheDay.py
--- KarambaVerseOfTheDay/KarambaVerseOfTheDay.py 2003-12-01 08:31:06.000000000 -0600
+++ modificado/KarambaVerseOfTheDay.py 2009-07-20 13:54:51.000000000 -0500
@@ -52,15 +52,15 @@
book='', chapter='', verse='')

CHAR_W = 6
-CHAR_H = 15
-VERSE_MAX_WIDTH = 170 / CHAR_W # 170 is the width of the bg-image
+CHAR_H = 16
+VERSE_MAX_WIDTH = 180 / CHAR_W # 170 is the width of the bg-image
VERSE_BG_X, VERSE_BG_Y = (0,15)
VERSE_COLOR = (5, 64, 78)

-VERSE_URL = "http://votd.christ.com/biblevotd/votd-nas.js"
+VERSE_URL = "http://votd.christ.com/biblevotd/votd-kjv.js"
BOOK_CHAPTER_PATTERN = re.compile('<div align=left><I>(.+)</I>')
VERSE_PATTERN = re.compile('votd1 = "(.+)<BR>\s*<br>')
-SUP_PATTERN = re.compile('(<SUP> )|(</SUP>)')
+SUP_PATTERN = re.compile('(<sup>)|(</sup>)')
BR_PATTERN = re.compile('(<BR>)|(<br>)')
DEL_PATTERN = re.compile(r'(&nbsp;)|(\\")')

@@ -91,7 +91,7 @@
book = ' '.join(bookChapterL[:-1])
chapter = bookChapterL[-1]
verse = VERSE_PATTERN.search(line).group(1)
- verse = SUP_PATTERN.sub(' * ',verse)
+ verse = SUP_PATTERN.sub('*',verse)
verse = BR_PATTERN.sub('\n', verse)
verse = DEL_PATTERN.sub('',verse)
except Exception, e:
@@ -104,7 +104,7 @@
# Karamba functions
#
def initWidget(widget):
- karamba.attachClickArea(widget, karamba.getThemeText(widget,'BACKGROUND'))
+ karamba.attachClickArea(widget, karamba.getThemeImage(widget,'BACKGROUND'))
widgetUpdated(widget)

def widgetUpdated(widget):
@@ -136,17 +136,17 @@

def _show_verse(widget):
verseL = textwrap.wrap(VAR.verse, VERSE_MAX_WIDTH)
- bgHeight = CHAR_H*len(verseL)+4
+ bgHeight = CHAR_H*len(verseL)+21
bgW = karamba.createImage(widget, VERSE_BG_X, VERSE_BG_Y,
'images/details_bg.png')
for i in range(5, bgHeight, 8):
karamba.resizeImage(widget, bgW, 180, i)
karamba.redrawWidget(widget)
- karamba.resizeImage(widget, bgW, 180, bgHeight)
+ karamba.resizeImage(widget, bgW, 180, bgHeight+8)
karamba.redrawWidget(widget)

- verseW = karamba.createText(widget, VERSE_BG_X+10, VERSE_BG_Y+4,
- 170, bgHeight, '\n'.join(verseL))
+ verseW = karamba.createText(widget, VERSE_BG_X+10, VERSE_BG_Y+12,
+ 180, bgHeight, '\n'.join(verseL)) #text position
karamba.changeTextSize(widget, verseW, 11)
karamba.changeTextColor(widget, verseW, *VERSE_COLOR)

Sólo en modificado: KarambaVerseOfTheDay.py~
Sólo en modificado: KarambaVerseOfTheDay.pyc
diff -rau KarambaVerseOfTheDay/KarambaVerseOfTheDay.theme modificado/KarambaVerseOfTheDay.theme
--- KarambaVerseOfTheDay/KarambaVerseOfTheDay.theme 2003-11-14 09:18:53.000000000 -0600
+++ modificado/KarambaVerseOfTheDay.theme 2009-07-20 13:56:27.000000000 -0500
@@ -1,4 +1,4 @@
-KARAMBA X=5 Y=5 W=180 H=180 INTERVAL=3600000 LOCKED=true
+KARAMBA X=5 Y=5 W=180 H=350 INTERVAL=3600000 LOCKED=true

# BACKGROUND IMAGE
<GROUP> X=0 Y=1
Sólo en modificado: KarambaVerseOfTheDay.theme~

Report

notanuseryet

11 years ago

edit KarambaVerseOfTheDay.py
change line 107 from:
karamba.getThemeText(widget,'BACKGROUND')
to:
karamba.getThemeImage(widget,'BACKGROUND')
and line 139 from:
bgHeight = CHAR_H*len(verseL)+4
to:
bgHeight = CHAR_H*len(verseL)+14
Gby

Report

SamerAdra

15 years ago

I have the more recent versions of python and superkaramba.

Call to initWidget failed
Traceback (most recent call last):
File "/home/samer/.superkaramba/KarambaVerseOfTheDay/KarambaVerseOfTheDay.py", line 107, in initWidget
karamba.attachClickArea(widget, karamba.getThemeText(widget,'BACKGROUND'))
TypeError: meter is not type of TextLabel.

Report

joeservant

16 years ago

I am pleased that you where able to fix the problem for person who could not see the verse listed. However, I would have appreciated it if you would have listed the fix right here for the rest of us.

I also cannot see the verse and I do not imagine I am the only one. I have the latest version, 0.3 so I do not know what is going on.

Please help me too.

Joe

Report

C

winelli

16 years ago

What I did to fix the problem for the rest (in fact everybody), was that I adapted the source-html parsing to the changes there was in it. This fix is in the newest version (0.3).

Could you please start the theme from the commandline so that you'll get an error-traceback. Also which python and superkaramba version are you running?
Without knowing what the exact problem is, it's impossible to fix it ;)

Report

joeservant

16 years ago

Traceback (most recent call last):
File "/home/joe/My Documents/Karamba Themes/KarambaVerseOfTheDay/KarambaVerseOfTheDay.py", line 39, in ?
import re, time, urllib, textwrap
ImportError: No module named textwrap
------------------------------------------------------
What does ImportError mean?

It means that I couldn't load a python add-on for KarambaVerseOfTheDay.theme
If this is a regular theme and doesn't use python
extensions, then nothing is wrong.

This is the error that I end up receiving, any ideas? I have python v2.2.2 by the looks of it.

JOe

Report

C

winelli

16 years ago

As I said in the description, I'm using the python textwrap module which is unfortunately available in Python2.3 and higher only!
So the only way to get it fixed is to upgrade your Python version. Sorry! Of course it would be possible to implement your own textwrapping, but since there is one standard one I didn't do that ;)

Report

Clete2

16 years ago

You need python 2.3 as it says, works for me...

Does anyone get crashes? It seems to crash half the time I load it. I load it along with liquid weather plus and minimon, this seems to be the only one that crashes...

Report

C

winelli

16 years ago

What do you mean by crashes (any traceback)? It has never crashed for me. ;)

Report

Clete2

16 years ago

Sorry, it's not currently crashing (I have to use ctrl alt escape and click on it to close it)... It goes blank and right-clicking or left-clicking will not work... It seems to happen randomly. I'll get back to you (or try to) if I can reproduce it... It was happening a lot but now it's not...

Report

Clete2

16 years ago

Sorry, micromon, not minimon

Report

Clete2

16 years ago

Ah, I'm adding it in a minute. Been looking for more Christian karambas... :)

Report

Clete2

16 years ago

This will be perfect for my mom's old computer... Nobody uses it but my little sister for barbie... I'm thinking we wipe all the Windows crap on it and make a beautiful KDE theme... And I've found a karamba to use, my mom will like it :)...

Report

trekjunky

16 years ago

Hi. I love the idea of the Karamba Verse of the Day theme. When I launch SuperKaramba and pick your theme, all I get is a Cross and a blank bar. When I start it from the command line, I get the following error:
Error parsing verse "if (now.getDay() == 0) {votd1 = "and My people who are called by My name humble themselves and pray and seek My face and turn from their wicked ways, then I will hear from heaven, will forgive their sin and will heal th" ('NoneType' object has no attribute 'group')icles 7:14 (NASB)";}
Can you help? I am new to Linux and would appreciate it if you could provide detailed instructions. Thank you very much in advance. God Bless.

Report

trekjunky

16 years ago

Thank you very much for the quick response. Thank you for fixing my problem. I downloaded the 0.3 version and it works perfectly!!! God Bless

Report

trekjunky

16 years ago

Hi. I love the idea of the Karamba Verse of the Day theme. When I launch SuperKaramba and pick your theme, all I get is a Cross and a blank bar. When I start it from the command line, I get the following error:
Error parsing verse "if (now.getDay() == 0) {votd1 = "and My people who are called by My name humble themselves and pray and seek My face and turn from their wicked ways, then I will hear from heaven, will forgive their sin and will heal th" ('NoneType' object has no attribute 'group')icles 7:14 (NASB)";}
Can you help? I am new to Linux and would appreciate it if you could provide detailed instructions. Thank you very much in advance. God Bless.

Report

NateTheMagi

16 years ago

I love this theme, but all I get is a small bar with a cross, not the verse or any text. Can I change the location of where the text is pulled from (say if I want a diff. version)?

Thanks much!

Report

C

winelli

16 years ago

What version of Python are you using? Do you get an error-traceback if you start superkaramba and this theme from the command-line?
To change the source you would have to override the "get_verse_of_the_day" function.

Report

C

winelli

16 years ago

I just noticed that if you only want to use another bible translation you can just change the last part of the VERSE_URL variable in KarambaVerseOfTheDay.py module.


New American Standard Version (current)
VERSE_URL = "http://votd.christ.com/biblevotd/votd-nas.js"

King James Version
VERSE_URL = "http://votd.christ.com/biblevotd/votd-kjv.js"

New International Version
VERSE_URL = "http://votd.christ.com/biblevotd/votd-niv.js"

Report

maitre

16 years ago

Thats definitely a new karamba idea - can we do one based off of fortune?
-maitre

Report

hrholme

16 years ago

Atheism... Yeah!

Report

anopenscroll

16 years ago

The truth shall set you free, yeah! (hmm remind me of the matrix now)

Very useful anyhow!

Report

16 years ago

0.2 - Showing the Book and the Chapter information separately.

0.3 - Fixed the regex-patterns so that it works with the changes made in the source html.

12345678910
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.3
updated Dec 01 2003
added Nov 14 2003
downloads 24h
0
mediaviews 24h 0
pageviews 24h 0