
KarambaVerseOfTheDay
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
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
17 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.
17 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
--- 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'( )|(\\")')
@@ -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
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
16 years ago
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
17 years ago
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
winelli
17 years ago
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
17 years ago
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
winelli
17 years ago
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
17 years ago
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
winelli
17 years ago
Report
Clete2
17 years ago
Report
Clete2
17 years ago
Report
Clete2
17 years ago
Report
Clete2
17 years ago
Report
trekjunky
17 years ago
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
17 years ago
Report
trekjunky
17 years ago
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
17 years ago
Thanks much!
Report
winelli
17 years ago
To change the source you would have to override the "get_verse_of_the_day" function.
Report
winelli
17 years ago
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
17 years ago
-maitre
Report
hrholme
17 years ago
Report
anopenscroll
17 years ago
Very useful anyhow!
Report