pywmreceived/pywmreceived.py

303 lines
25 KiB
Python
Executable File

#!./venv/bin/python3
"""pywmnop.py
WindowMaker dockapp pidgin messages
Copyright (C) 2006 Mario Frasca
Licensed under the GNU General Public License.
"""
import logging
from wmdocklib import wmoo as wmoo
line_height = 9
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class Application(wmoo.Application):
def __init__(self, *args, **kwargs):
wmoo.Application.__init__(self, *args, **kwargs)
self._count = 0
self._flasher = 0
self.backlit = 0
self.lines = [ # name, messages received
[" CATHY", 0],
[" FRANK", 0],
[" TIM", 0],
[" LEE", 0],
[" TANDA", 0],
[" OTHER", 0],
]
def draw_string(self, xstart, ystart, text):
for char in text:
if char >= "A" and char <="Z":
x = (ord(char) -65) * 6
y = 1
elif char >= "0" and char <="9":
x = (ord(char) -48) * 6
y = 10
elif char == " ":
x = 6 * 10
y = 10
elif char == "-":
x = 6 * 11
y = 10
elif char == ".":
x = 6 * 12
y = 10
elif char == "'":
x = 6 * 13
y = 10
elif char == "(":
x = 6 * 14
y = 10
elif char == ")":
x = 6 * 15
y = 10
elif char == "*":
x = 6 * 16
y = 10
elif char == "/":
x = 6 * 17
y = 10
else:
continue
self.putPattern(x, y + (self.backlit * 17), 6, 7, xstart, ystart)
xstart += 6
def draw_background(self):
self.putPattern(0 + (self.backlit * 62), 36, 64, 64, 0, 0)
def draw_all_text(self):
for index, line in enumerate(self.lines[:6]):
self.draw_string(9, 6 + (index * line_height), line[0])
def toggle_backlight(self, event):
self.backlit = 1 - self.backlit
self.draw_background()
self.draw_all_text()
def update(self):
wmoo.Application.update(self)
self._count += 1
if self._count <= 3:
return
self._count = 0
if self._flasher:
self._flasher -= 1
self.toggle_backlight(True)
palette = {
".": "#767C6F",
"+": "#010101",
"@": "#8E968A",
"#": "#505055",
"$": "#6CB237",
"%": "#6EC63B",
"&": "#4F8327",
"*": "#020202",
"=": "#0A0A0A",
"-": "#484C46",
"<": "#DEDEDE",
">": "#7C827C",
}
background = [
" ",
" ",
" ****************************************************** ",
" *======================================================* ",
" *==-----------------------------------------------------*< ",
" *=-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*< ",
" *=->>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@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@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**< ",
" *******************************************************< ",
" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ",
" ",
" ",
" ",
]
patterns = [
" ",
".+++.@#+++@@#+++#@#+++@@#+++#@#+++#@#+++#@#...#@@...#@@...#@#...#@#...@@+...+@#+++@@#+++#@#+++#@#+++#@#+++#@#+++#@#+++#@#...#@#...#@#...#@#...#@#...#@#+++#@",
"+@@@+@+@@@+@+@@@.@+@@@+@+@@@.@+@@@.@+@@@.@+@@@+@.@@@+@.@@@+@+@@@+@+@@@.@++@++@+@@@+@+@@@+@+@@@+@+@@@+@+@@@+@+@@@.@.@+@.@+@@@+@+@@@+@+@@@+@+@@@+@+@@@+@.@@@+@",
"+@@@+@+@@@+@+@@@.@+@@@+@+@@@.@+@@@.@+@@@.@+@@@+@.@@@+@.@@@+@+@@+.@+@@@.@+@+@+@+@@@+@+@@@+@+@@@+@+@@@+@+@@@+@+@@@.@.@+@.@+@@@+@+@@@+@+@@@+@.+@+.@+@@@+@.@@+.@",
"#+++#@#+++@@#...@@#...#@#+++@@#+++@@#.++#@#+++#@@...#@@...#@#++.@@#...@@#...#@#...#@#...#@#+++#@#+..#@#+++@@#+++#@@.#.@@#...#@#...#@#...#@@.+.@@#+++#@@.+.@@",
"+@@@+@+@@@+@+@@@.@+@@@+@+@@@.@+@@@.@+@@@+@+@@@+@.@@@+@.@@@+@+@@+.@+@@@.@+@@@+@+@@@+@+@@@+@+@@@.@+@+@+@+@@@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+%+%&%+%$+%%$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
"%+++%%%$$$+%&+++&%&+++&%%$$$&%&+++&%&+++&%%$$$&%&+++&%&+++&%%$$$%%%$$$%%%&+&%%%$$$%%%+$$%%%$$+%%%$$$%%%+$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%",
" ",
" ",
" ",
" ****************************************************** ****************************************************** ",
" *======================================================* ******************************************************** ",
# " *======================================================* *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%* ",
" *==-----------------------------------------------------*< **%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *=->@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" *******************************************************< *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%< ",
" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ",
" ",
" ",
]
def main():
"""
The main entry point of the application.
"""
app = Application(font_name='5x8',
margin = 3,
bg=0,
fg=2,
palette = palette,
background = background,
patterns = patterns)
# app.addCallback(app.previousRadio, 'buttonrelease', area=( 6,29,15,38))
# 6x7 grey1=1 grey2=10 green1=18 green2=27
app.draw_background()
app.draw_all_text()
app.addCallback(app.toggle_backlight, 'buttonrelease', area=(2,2,62,62))
app.run()
if __name__ == '__main__':
main()