91 lines
5.2 KiB
HTML
91 lines
5.2 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module robofab.tools.rfPrefs</title>
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="robofab.html"><font color="#ffffff">robofab</font></a>.<a href="robofab.tools.html"><font color="#ffffff">tools</font></a>.rfPrefs</strong></big></big></font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/code/projects/robofab/Lib/robofab/tools/rfPrefs.py">/code/projects/robofab/Lib/robofab/tools/rfPrefs.py</a></font></td></tr></table>
|
|
<p><tt>A simple module for dealing with preferences that are used by scripts. Based almost entirely on MacPrefs.<br>
|
|
<br>
|
|
To save some preferences:<br>
|
|
myPrefs = <a href="#RFPrefs">RFPrefs</a>(drive/directory/directory/myPrefs.plist)<br>
|
|
myPrefs.myString = 'xyz'<br>
|
|
myPrefs.myInteger = 1234<br>
|
|
myPrefs.myList = ['a', 'b', 'c']<br>
|
|
myPrefs.myDict = {'a':1, 'b':2}<br>
|
|
myPrefs.save()<br>
|
|
<br>
|
|
To retrieve some preferences:<br>
|
|
myPrefs = <a href="#RFPrefs">RFPrefs</a>(drive/directory/directory/myPrefs.plist)<br>
|
|
myString = myPrefs.myString<br>
|
|
myInteger = myPrefs.myInteger<br>
|
|
myList = myPrefs.myList<br>
|
|
myDict = myPrefs.myDict<br>
|
|
<br>
|
|
When using this module within FontLab, it is not necessary to<br>
|
|
provide the <a href="#RFPrefs">RFPrefs</a> class with a path. If a path is not given,<br>
|
|
it will look for a file in FontLab/RoboFab Data/<a href="#RFPrefs">RFPrefs</a>.plist.<br>
|
|
If that file does not exist, it will make it.</tt></p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<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%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</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 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<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"><a href="robofab.tools.rfPrefs.html#_PrefObject">_PrefObject</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="robofab.tools.rfPrefs.html#RFPrefs">RFPrefs</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="RFPrefs">class <strong>RFPrefs</strong></a>(<a href="robofab.tools.rfPrefs.html#_PrefObject">_PrefObject</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>The main preferences object to call<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="RFPrefs-__getattr__"><strong>__getattr__</strong></a>(self, attr)</dt></dl>
|
|
|
|
<dl><dt><a name="RFPrefs-__init__"><strong>__init__</strong></a>(self, path<font color="#909090">=None</font>)</dt></dl>
|
|
|
|
<dl><dt><a name="RFPrefs-save"><strong>save</strong></a>(self)</dt><dd><tt>save the plist file</tt></dd></dl>
|
|
|
|
<hr>
|
|
Methods inherited from <a href="robofab.tools.rfPrefs.html#_PrefObject">_PrefObject</a>:<br>
|
|
<dl><dt><a name="RFPrefs-__delattr__"><strong>__delattr__</strong></a>(self, attr)</dt></dl>
|
|
|
|
<dl><dt><a name="RFPrefs-__len__"><strong>__len__</strong></a>(self)</dt></dl>
|
|
|
|
<dl><dt><a name="RFPrefs-__setattr__"><strong>__setattr__</strong></a>(self, attr, value)</dt></dl>
|
|
|
|
<dl><dt><a name="RFPrefs-asDict"><strong>asDict</strong></a>(self)</dt></dl>
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#eeaa77">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl><dt><a name="-StringIO"><strong>StringIO</strong></a>(...)</dt><dd><tt><a href="#-StringIO">StringIO</a>([s]) -- Return a StringIO-like stream for reading or writing</tt></dd></dl>
|
|
</td></tr></table>
|
|
</body></html> |