1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module pyosd</title>
<style type="text/css"><!--
TT { font-family: lucidatypewriter, lucida console, courier }
--></style></head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0>
<tr bgcolor="#7799ee">
<td valign=bottom><small> <br></small
><font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>pyosd</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/resolve/Code/pyosd/pyosd.py">/home/resolve/Code/pyosd/pyosd.py</a></font></td></tr></table>
<p><small><tt>pyosd - a wrapper of libxosd which allows the displaying of "on screen display"<br>
messages.<br>
<br>
example usage:<br>
<br>
| import pyosd<br>
| p = pyosd.<a href="#osd">osd</a>()<br>
| # try fixed if the default_font gives you an <a href="#error">error</a><br>
|<br>
| p.display("eschew obfuscation")<br>
| p.set_pos(pyosd.POS_BOT)<br>
| p.display("this will be down the bottom.")<br>
<br>
<br>
.. etc.<br>
<br>
Multiple instances can be used to display information in different<br>
fonts or colours across the screen.</tt></small></p>
<p><table width="100%" cellspacing=0 cellpadding=2 border=0>
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom><small><small> <br></small></small
><font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%"><tr><td width="25%" valign=top><a href="_pyosd.html">_pyosd</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=2 border=0>
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom><small><small> <br></small></small
><font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><small><a href="exceptions.html#Exception">exceptions.Exception</a>
</small></font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><small><a href="pyosd.html#error">error</a>
</small></font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><small><a href="pyosd.html#osd">osd</a>
</small></font></dt></dl>
<p><table width="100%" cellspacing=0 cellpadding=2 border=0>
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom><small><small> <br></small></small
><font color="#000000" face="helvetica, arial"><a name="error">class <strong>error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><small><small> </small></small></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt><a name="error-__getitem__"><strong>__getitem__</strong></a>(...)<small><font color="#909090"><font face="helvetica, arial"> from <a href="exceptions.html#Exception">exceptions.Exception</a></font></font></small></dl>
<dl><dt><a name="error-__init__"><strong>__init__</strong></a>(...)<small><font color="#909090"><font face="helvetica, arial"> from <a href="exceptions.html#Exception">exceptions.Exception</a></font></font></small></dl>
<dl><dt><a name="error-__str__"><strong>__str__</strong></a>(...)<small><font color="#909090"><font face="helvetica, arial"> from <a href="exceptions.html#Exception">exceptions.Exception</a></font></font></small></dl>
</td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=2 border=0>
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom><small><small> <br></small></small
><font color="#000000" face="helvetica, arial"><a name="osd">class <strong>osd</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><small><tt> <a href="#osd">osd</a> is a class used to create an object which can display messages on<br>
the screen.<br> </tt></small></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt><a name="osd-__del__"><strong>__del__</strong></a>(self)<dd><small><tt> Shut down and clean up.<br>
<br>
Note that init() will automatically do this step if necessary.</tt></small></dl>
<dl><dt><a name="osd-__init__"><strong>__init__</strong></a>(self, font<small><font color="#909090">='-adobe-helvetica-medium-r-normal-*-*-400-*-*-p-*-iso8859-1'</font></small>, colour<small><font color="#909090">='#FFFFFF'</font></small>, timeout<small><font color="#909090">=3</font></small>, pos<small><font color="#909090">=0</font></small>, offset<small><font color="#909090">=0</font></small>, shadow<small><font color="#909090">=0</font></small>, lines<small><font color="#909090">=2</font></small>)<dd><small><tt> Initialise the OSD library.<br>
<br>
This must be done before <a href="#osd-display">display</a>() will work. It will automatically<br>
deinit if necessary.<br>
<br>
font(pyosd.default_font): standard string-style X font description<br>
colour('#FFFFFF'): standard string-style X colour description<br>
timeout(3): number of seconds to remain on screen (-1 for infinite)<br>
pos(POS_TOP): position, one of POS_TOP or POS_BOT<br>
offset(0): vertical offset from pos<br>
shadow(0): black shadow size<br>
lines(2): the max number of lines available to display at once<br>
<br>
Unfortunately due to constraints with the underlying library, lines has<br>
to be hard coded on init() at the moment.</tt></small></dl>
<dl><dt><a name="osd-display"><strong>display</strong></a>(self, arg, type<small><font color="#909090">=0</font></small>, line<small><font color="#909090">=0</font></small>)<dd><small><tt> Display a string/bargraph/percentage using information from init()<br>
<br>
arg: a string or integer from 1-100, depending on the type<br>
-- defaults --<br>
type(TYPE_STRING): one of TYPE_STRING, TYPE_PERCENT, or TYPE_SLIDER<br>
line(0): the line to display text on<br>
<br>
The underlying library currently doesn't zero out previous lines that<br>
aren't being used, so if you wish to display something on, say, line 1,<br>
make sure you simultaneously display "" on line 0.</tt></small></dl>
<dl><dt><a name="osd-set_colour"><strong>set_colour</strong></a>(self, c)<dd><small><tt> Change the colour.<br>
<br>
This will update when <a href="#osd-display">display</a>() is next called.</tt></small></dl>
<dl><dt><a name="osd-set_font"><strong>set_font</strong></a>(self, font)<dd><small><tt> Change the font.<br>
<br>
This takes effect immediately.</tt></small></dl>
<dl><dt><a name="osd-set_offset"><strong>set_offset</strong></a>(self, o)<dd><small><tt> Change the vertical offset from the top or bottom.<br>
<br>
This change is immediate.</tt></small></dl>
<dl><dt><a name="osd-set_pos"><strong>set_pos</strong></a>(self, p)<dd><small><tt> Change the position to the top or bottom.<br>
<br>
This change is immediate.</tt></small></dl>
<dl><dt><a name="osd-set_shadow_offset"><strong>set_shadow_offset</strong></a>(self, o)<dd><small><tt> Set the offset of the shadow.<br>
<br>
This change will take effect on the next <a href="#osd-display">display</a>()</tt></small></dl>
<dl><dt><a name="osd-set_timeout"><strong>set_timeout</strong></a>(self, t)<dd><small><tt> Change the timeout.<br>
<br>
This takes effect immediately; anything that is currently displayed<br>
will wait the new timeout time before clearing.</tt></small></dl>
</td></tr></table></td></tr></table>
<p><table width="100%" cellspacing=0 cellpadding=2 border=0>
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom><small><small> <br></small></small
><font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>POS_BOT</strong> = 1<br>
<strong>POS_TOP</strong> = 0<br>
<strong>TYPE_PERCENT</strong> = 1<br>
<strong>TYPE_SLIDER</strong> = 2<br>
<strong>TYPE_STRING</strong> = 0<br>
<strong>__file__</strong> = './pyosd.py'<br>
<strong>__name__</strong> = 'pyosd'<br>
<strong>default_font</strong> = '-adobe-helvetica-medium-r-normal-*-*-400-*-*-p-*-iso8859-1'</td></tr></table>
</body></html>
|