Python: module pyosd

pyosd | index /home/resolve/Code/pyosd/pyosd.py

`pyosd - a wrapper of libxosd which allows the displaying of "on screen display"
messages.
example usage:
| import pyosd
| p = pyosd.osd()
| # try fixed if the default_font gives you an error
|
| p.display("eschew obfuscation")
| p.set_pos(pyosd.POS_BOT)
| p.display("this will be down the bottom.")
.. etc.
Multiple instances can be used to display information in different
fonts or colours across the screen.`

Modules
`` |  |
_pyosd |  |  |

Classes
`` |  | exceptions.Exception error osd
class error(exceptions.Exception)
`` |
| __getitem__(...) from exceptions.Exception __init__(...) from exceptions.Exception __str__(...) from exceptions.Exception
class osd
`` | `osd is a class used to create an object which can display messages on the screen.`
| __del__(self) `Shut down and clean up. Note that init() will automatically do this step if necessary.` __init__(self, font='-adobe-helvetica-medium-r-normal-*-*-400-*-*-p-*-iso8859-1', colour='#FFFFFF', timeout=3, pos=0, offset=0, shadow=0, lines=2) `Initialise the OSD library. This must be done before display() will work. It will automatically deinit if necessary. font(pyosd.default_font): standard string-style X font description colour('#FFFFFF'): standard string-style X colour description timeout(3): number of seconds to remain on screen (-1 for infinite) pos(POS_TOP): position, one of POS_TOP or POS_BOT offset(0): vertical offset from pos shadow(0): black shadow size lines(2): the max number of lines available to display at once Unfortunately due to constraints with the underlying library, lines has to be hard coded on init() at the moment.` display(self, arg, type=0, line=0) `Display a string/bargraph/percentage using information from init() arg: a string or integer from 1-100, depending on the type -- defaults -- type(TYPE_STRING): one of TYPE_STRING, TYPE_PERCENT, or TYPE_SLIDER line(0): the line to display text on The underlying library currently doesn't zero out previous lines that aren't being used, so if you wish to display something on, say, line 1, make sure you simultaneously display "" on line 0.` set_colour(self, c) `Change the colour. This will update when display() is next called.` set_font(self, font) `Change the font. This takes effect immediately.` set_offset(self, o) `Change the vertical offset from the top or bottom. This change is immediate.` set_pos(self, p) `Change the position to the top or bottom. This change is immediate.` set_shadow_offset(self, o) `Set the offset of the shadow. This change will take effect on the next display()` set_timeout(self, t) `Change the timeout. This takes effect immediately; anything that is currently displayed will wait the new timeout time before clearing.`

Data
`` |  | POS_BOT = 1 POS_TOP = 0 TYPE_PERCENT = 1 TYPE_SLIDER = 2 TYPE_STRING = 0 __file__ = './pyosd.py' __name__ = 'pyosd' default_font = '-adobe-helvetica-medium-r-normal-*-*-400-*-*-p-*-iso8859-1'