275 lines
7.3 KiB
HTML
275 lines
7.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
"http://www.w3.org/TR/html40/loose.dtd">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<title>Class: Preferences</title>
|
|
</head>
|
|
|
|
<body bgcolor="#ffffff">
|
|
|
|
<p><i><a href="../../../../../../../../../../index.html">Table of Contents</a></i></p>
|
|
|
|
<table border="0" cellpadding="5" cellspacing="0" width="100%">
|
|
<tr>
|
|
<th rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="10%"
|
|
bgcolor="#88bbee"><font color="#000000">Class: Preferences</font>
|
|
</th>
|
|
<th bgcolor="#88bbee"
|
|
width="90%"
|
|
align="right"><font color="#000000">CryptoBoxPreferences.py</font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
|
|
<h3>This class handles preferences and stores them into given configfile</h3>
|
|
<p> To use it :
|
|
- instanciate a Preferences object :
|
|
myPP=Preferences()
|
|
- to get a preference :
|
|
mypref=myPP["ma_preference"]
|
|
- to set a preference :
|
|
myPP["ma_preference"]=xxx</p>
|
|
<p> The preferences are automatically loaded on the first instanciation of this
|
|
class and are saved when a value is added or changed automatically, too.</p>
|
|
<table border="0" cellpadding="5" cellspacing="0" width="100%">
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="Methods">Methods</a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000"> </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
|
|
<a href="#__getitem__">__getitem__</a><br>
|
|
<a href="#__init__">__init__</a><br>
|
|
<a href="#__loadConfig">__loadConfig</a><br>
|
|
<a href="#__saveConfig">__saveConfig</a><br>
|
|
<a href="#__setitem__">__setitem__</a><br>
|
|
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="__getitem__"></a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000">__getitem__ </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<font color="#000088"><pre>
|
|
__getitem__ ( self, name )
|
|
|
|
</pre></font>
|
|
|
|
<h3>Return the preferences for the given item</h3>
|
|
<p> @param String name : Name of the item for which we return a value
|
|
@return String : value of the pref, or None if inexistant
|
|
@since 1.1.2.7
|
|
@author C.Dutoit <dutoitc@hotmail.com></p>
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="__init__"></a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000">__init__ </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<font color="#000088"><pre>
|
|
__init__ ( self, filename )
|
|
|
|
</pre></font>
|
|
|
|
<h3>Constructor</h3>
|
|
<p> @author C.Dutoit <dutoitc@hotmail.com></p>
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="__loadConfig"></a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000">__loadConfig </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<font color="#000088"><pre>
|
|
__loadConfig ( self )
|
|
|
|
</pre></font>
|
|
|
|
<h3>Load datas from config file</h3>
|
|
<p> @since 1.1.2.5
|
|
@author C.Dutoit <dutoitc@hotmail.com></p>
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="__saveConfig"></a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000">__saveConfig </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<font color="#000088"><pre>
|
|
__saveConfig ( self )
|
|
|
|
</pre></font>
|
|
|
|
<h3>Save datas to config file</h3>
|
|
<p> @since 1.1.2.5
|
|
@author C.Dutoit <dutoitc@hotmail.com></p>
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="__setitem__"></a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000">__setitem__ </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<font color="#000088"><pre>
|
|
__setitem__ (
|
|
self,
|
|
name,
|
|
value,
|
|
)
|
|
|
|
</pre></font>
|
|
|
|
<h3>Return the preferences for the given item</h3>
|
|
<p> @param String name : Name of the item WITHOUT SPACES
|
|
@param String Value : Value for the given name
|
|
@raises TypeError : if the name contains spaces
|
|
@since 1.1.2.7
|
|
@author C.Dutoit <dutoitc@hotmail.com></p>
|
|
<table border="0" cellpadding="5" cellspacing="0" width="100%">
|
|
|
|
<tr>
|
|
<th bgcolor="#99ccff"
|
|
rowspan="2"
|
|
valign="top"
|
|
align="left"
|
|
width="20%"
|
|
>
|
|
<font color="#000000">
|
|
<a name="Exceptions">Exceptions</a>
|
|
</font>
|
|
</th>
|
|
<th bgcolor="#99ccff"
|
|
valign="top"
|
|
align="left"
|
|
width="80%"
|
|
>
|
|
<font color="#000000"> </font>
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
|
|
TypeError, "Name cannot contain a space"<br>
|
|
|
|
</td></tr>
|
|
</table>
|
|
</td></tr>
|
|
</td></tr>
|
|
</table>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<p><i><a href="../../../../../../../../../../index.html">Table of Contents</a></i></p>
|
|
|
|
<font size="-2"><i>This document was automatically generated
|
|
on Wed Aug 16 13:00:54 2006 by
|
|
<a href="http://happydoc.sourceforge.net">HappyDoc</a> version
|
|
2.1</i></font>
|
|
|
|
</body>
|
|
</html>
|
|
|