cleaned up; used happdoc

This commit is contained in:
age 2006-08-16 11:07:57 +00:00
parent c473798003
commit 9cab568312
18 changed files with 2190 additions and 52 deletions

View file

@ -1,27 +1,36 @@
#!/usr/bin/env python
'''
This is a secure fileserver with encrypted filesystem and webinterface.
It was originally written in bash/perl. Now a complete rewrite is in
progress. So things might be confusing here. Hopefully not for long.
:)
'''
import re
import CryptoBoxPreferences, CryptoBoxLogger, CryptoBoxContainer
import CryptoBoxLogger
import CryptoBoxContainer
import CryptoBoxPreferences
class CryptoBox:
'''Get and set the properties of a CryptoBox'''
CONFIG_FILE="cbx.conf"
class CryptoBoxProps:
'''Get and set the properties of a CryptoBox
This class returns the available _and_ allowed devices, which will
be used further.
'''
def __init__(self):
'''reset all variables to default settings'''
self.cbxPrefs = CryptoBoxPreferences.Preferences()
'''read config and fill class variables'''
print CONFIG_FILE
self.cbxPrefs = CryptoBoxPreferences.Preferences(CONFIG_FILE)
self.debug = CryptoBoxLogger.CryptoBoxLogger(
self.cbxPrefs["debuglevel"],
self.cbxPrefs["debugfacility"],
self.cbxPrefs["logfile"] )
self.alloweddevices = self.csv2list(self.cbxPrefs["allowed_devices"])
self.containers = []
for device in self.allAvailablePartitions():
if self.deviceIsReallyAllowed(device):
self.containers.append(CryptoBoxContainer.CryptoBoxContainer(device))
self.alloweddevices = self.__csv2list(self.cbxPrefs["allowed_devices"])
############################
### internal methods
def csv2list(self, csvstring):
def __csv2list(self, csvstring):
'''transform a csv preferences string into a list'''
commalist = csvstring.split(",") # split the csv by ","
list = []
@ -29,15 +38,17 @@ class CryptoBox:
list.append(element.strip()) # remove whitespaces
return list
def deviceIsReallyAllowed(self, device):
def __deviceIsReallyAllowed(self, device):
'''return "true" if the given device is white-listed for being used as cryptobox container'''
for a in self.alloweddevices:
if re.search('^' + a, device):
#print "%s allowed for cbx" % a
return True
def allAvailablePartitions(self):
'''retrieve a list of all available containers'''
def __allAvailablePartitions(self):
'''retrieve a list of all available containers
TODO: if the code is not like a poem, write prosadocumentation ;)
'''
ret_list = []
try:
fpart = open("/proc/partitions", "r")
@ -70,14 +81,16 @@ class CryptoBox:
CryptoBoxLogger.DebugLevels["warn"])
return []
##################################
### public methods
def debugMessage(self, level, text):
'''print a debug message to the previously choosen debugging facility'''
self.debug.printMessage(level,text)
def getContainerList(self):
'''return a list of all containers of this cryptobox'''
'''return a list of all actual available containers of this cryptobox'''
self.containers = []
for device in self.__allAvailablePartitions():
if self.__deviceIsReallyAllowed(device):
self.containers.append(CryptoBoxContainer.CryptoBoxContainer(device))
try:
return self.containers[:]
except AttributeError:
@ -90,5 +103,15 @@ class CryptoBox:
def setConfigValue(self, key, value):
'''save the strings key+value in configfile'''
self.cbxPrefs[key]=value
if __name__ == "__main__":
'''
Start the Cryptobox with: `python CryptoBox.py`
'''
cbprops = CryptoBoxProps()
#print "Allowed_Devices: %s" % (cb.getConfigValue("allowed_devices"), )
#print "non-existing: %s" % (cb.getConfigValue("alowed_devices"), )
print [e.device for e in cbprops.getContainerList()]
print "Config %s" % str(cbprops.getConfigValue("logfile"))
#cbprops.setConfigValue("foo","bar")

View file

@ -1,6 +1,13 @@
'''
TODO
'''
class CryptoBoxContainer:
'''
TODO
'''
def __init__(self, device):
self.device = device

View file

@ -1,6 +1,12 @@
'''
manages logging events of the CryptoBox
'''
import sys
class CryptoBoxLogger:
'''
handles concrete logging events and prints them e.g. to a logfile
'''
DebugLevels = {"debug":0, "info":3, "warn":6, "error":9}
DebugFacilities = {"file":0}

View file

@ -1,22 +1,20 @@
#!/usr/bin/env python
"""
This Class is derived mainly from 'gimini' project.
__version__ = "$Revision: 1.1 $"
__author__ = "C.Dutoit <dutoitc@hotmail.com>"
__date__ = "2003-2-14"
'''
read and write configuration
Thanx to Dutoit!
"""
This Class is derived mainly from 'gimini' project.
Thanx to Dutoit! <dutoitc(at)hotmail.com>
'''
from ConfigParser import *
import sys, os
### Set the Preferences filename
PREFS_FILENAME="cbx.conf"
class Preferences:
"""
This class handle preferences and store them into 'PREFS_FILENAME'
This class handles preferences and stores them into given configfile
To use it :
- instanciate a Preferences object :
@ -29,12 +27,13 @@ class Preferences:
The preferences are automatically loaded on the first instanciation of this
class and are saved when a value is added or changed automatically, too.
"""
def __init__(self):
def __init__(self, filename):
"""
Constructor
@author C.Dutoit <dutoitc@hotmail.com>
"""
self.prefsfilename = filename
self._config = None
self.__loadConfig()
@ -91,7 +90,7 @@ class Preferences:
@since 1.1.2.5
@author C.Dutoit <dutoitc@hotmail.com>
"""
f=open(PREFS_FILENAME, "w")
f=open(self.prefsfilename, "w")
self._config.write(f)
f.close()
@ -106,21 +105,21 @@ class Preferences:
"""
# Make sure that the configuration file exist
try:
f = open(PREFS_FILENAME, "r")
f = open(self.prefsfilename, "r")
f.close()
except:
try:
f = open(PREFS_FILENAME, "w")
f = open(self.prefsfilename, "w")
f.write("")
f.close()
except:
print "Can't make %s for saving preferences !" % PREFS_FILENAME
print "Can't make %s for saving preferences !" % self.prefsfilename
return
# Read datas
self._config=ConfigParser()
self._config.read(PREFS_FILENAME)
self._config.read(self.prefsfilename)
#>--------------------------------------------------------------------------

View file

@ -1,10 +1,6 @@
Klassen und Aktionen:
CryptoBox
DebugMessage(level,text)
isDeviceAllowed(devicename)
getConfigValue
setConfigValue
getContainerList(opt: type)
this is the future plan for the cbx python classes, you can find the actual classes under ./doc (generated by happydoc)
Classes and Methods:
CryptoBoxContainer
getName
getDevice

View file

@ -0,0 +1,377 @@
<?xml version="1.0"?>
<diagram xmlns:dia="http://www.lysator.liu.se/~alla/dia/">
<diagramdata>
<attribute name="background">
<color val="#ffffff"/>
</attribute>
<attribute name="paper">
<composite type="paper">
<attribute name="name">
<string>#A4#</string>
</attribute>
<attribute name="tmargin">
<real val="2.82"/>
</attribute>
<attribute name="bmargin">
<real val="2.82"/>
</attribute>
<attribute name="lmargin">
<real val="2.82"/>
</attribute>
<attribute name="rmargin">
<real val="2.82"/>
</attribute>
<attribute name="is_portrait">
<boolean val="true"/>
</attribute>
<attribute name="scaling">
<real val="1"/>
</attribute>
<attribute name="fitto">
<boolean val="false"/>
</attribute>
</composite>
</attribute>
</diagramdata>
<layer name="Background" visible="true">
<object type="Standard - Text" version="0" id="O11">
<attribute name="obj_pos">
<point val="6.0271,-4.71823"/>
</attribute>
<attribute name="text">
<composite type="text">
<attribute name="string">
<string>#HappyDoc Generated Documentation#</string>
</attribute>
<attribute name="font">
<font name="Helvetica-Bold"/>
</attribute>
<attribute name="height">
<real val="1"/>
</attribute>
<attribute name="pos">
<point val="6.0271,-4.71823"/>
</attribute>
<attribute name="color">
<color val="#000000"/>
</attribute>
<attribute name="alignment">
<enum val="1"/>
</attribute>
</composite>
</attribute>
</object>
<object type="UML - Class" version="0" id="O0">
<attribute name="obj_pos">
<point val="0.050000,0.050000"/>
</attribute>
<attribute name="obj_bb">
<rectangle val="0.000000,0.000000;8.172000,6.100000"/>
</attribute>
<attribute name="elem_corner">
<point val="0.050000,0.050000"/>
</attribute>
<attribute name="elem_width">
<real val="8.072000"/>
</attribute>
<attribute name="elem_height">
<real val="6.000000"/>
</attribute>
<attribute name="name">
<string>#Preferences#</string>
</attribute>
<attribute name="stereotype">
<string/>
</attribute>
<attribute name="abstract">
<boolean val="false"/>
</attribute>
<attribute name="suppress_attributes">
<boolean val="false"/>
</attribute>
<attribute name="suppress_operations">
<boolean val="false"/>
</attribute>
<attribute name="visible_attributes">
<boolean val="true"/>
</attribute>
<attribute name="visible_operations">
<boolean val="true"/>
</attribute>
<attribute name="attributes"/>
<attribute name="operations">
<composite type="umloperation">
<attribute name="name"><string>#__getitem__#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__init__#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__loadConfig#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__saveConfig#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__setitem__#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
</attribute>
<attribute name="template">
<boolean val="false"/>
</attribute>
<attribute name="templates"/>
</object><object type="UML - Class" version="0" id="O1">
<attribute name="obj_pos">
<point val="8.272000,0.050000"/>
</attribute>
<attribute name="obj_bb">
<rectangle val="8.222000,0.000000;16.394000,4.500000"/>
</attribute>
<attribute name="elem_corner">
<point val="8.272000,0.050000"/>
</attribute>
<attribute name="elem_width">
<real val="8.072000"/>
</attribute>
<attribute name="elem_height">
<real val="4.400000"/>
</attribute>
<attribute name="name">
<string>#CryptoBoxLogger#</string>
</attribute>
<attribute name="stereotype">
<string/>
</attribute>
<attribute name="abstract">
<boolean val="false"/>
</attribute>
<attribute name="suppress_attributes">
<boolean val="false"/>
</attribute>
<attribute name="suppress_operations">
<boolean val="false"/>
</attribute>
<attribute name="visible_attributes">
<boolean val="true"/>
</attribute>
<attribute name="visible_operations">
<boolean val="true"/>
</attribute>
<attribute name="attributes"/>
<attribute name="operations">
<composite type="umloperation">
<attribute name="name"><string>#__init__#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#message2file#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#printMessage#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
</attribute>
<attribute name="template">
<boolean val="false"/>
</attribute>
<attribute name="templates"/>
</object><object type="UML - Class" version="0" id="O2">
<attribute name="obj_pos">
<point val="16.494000,0.050000"/>
</attribute>
<attribute name="obj_bb">
<rectangle val="16.444000,0.000000;30.433600,8.500000"/>
</attribute>
<attribute name="elem_corner">
<point val="16.494000,0.050000"/>
</attribute>
<attribute name="elem_width">
<real val="13.889600"/>
</attribute>
<attribute name="elem_height">
<real val="8.400000"/>
</attribute>
<attribute name="name">
<string>#CryptoBoxProps#</string>
</attribute>
<attribute name="stereotype">
<string/>
</attribute>
<attribute name="abstract">
<boolean val="false"/>
</attribute>
<attribute name="suppress_attributes">
<boolean val="false"/>
</attribute>
<attribute name="suppress_operations">
<boolean val="false"/>
</attribute>
<attribute name="visible_attributes">
<boolean val="true"/>
</attribute>
<attribute name="visible_operations">
<boolean val="true"/>
</attribute>
<attribute name="attributes"/>
<attribute name="operations">
<composite type="umloperation">
<attribute name="name"><string>#__allAvailablePartitions#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__csv2list#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__deviceIsReallyAllowed#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#__init__#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#debugMessage#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#getConfigValue#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#getContainerList#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
<composite type="umloperation">
<attribute name="name"><string>#setConfigValue#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
</attribute>
<attribute name="template">
<boolean val="false"/>
</attribute>
<attribute name="templates"/>
</object><object type="UML - Class" version="0" id="O3">
<attribute name="obj_pos">
<point val="30.533600,0.050000"/>
</attribute>
<attribute name="obj_bb">
<rectangle val="30.483600,0.000000;36.716400,2.900000"/>
</attribute>
<attribute name="elem_corner">
<point val="30.533600,0.050000"/>
</attribute>
<attribute name="elem_width">
<real val="6.132800"/>
</attribute>
<attribute name="elem_height">
<real val="2.800000"/>
</attribute>
<attribute name="name">
<string>#CryptoBoxContainer#</string>
</attribute>
<attribute name="stereotype">
<string/>
</attribute>
<attribute name="abstract">
<boolean val="false"/>
</attribute>
<attribute name="suppress_attributes">
<boolean val="false"/>
</attribute>
<attribute name="suppress_operations">
<boolean val="false"/>
</attribute>
<attribute name="visible_attributes">
<boolean val="true"/>
</attribute>
<attribute name="visible_operations">
<boolean val="true"/>
</attribute>
<attribute name="attributes"/>
<attribute name="operations">
<composite type="umloperation">
<attribute name="name"><string>#__init__#</string></attribute>
<attribute name="type"><string/></attribute>
<attribute name="visibility"><enum val="0"/></attribute>
<attribute name="abstract"><boolean val="false"/></attribute>
<attribute name="class_scope"><boolean val="false"/></attribute>
<attribute name="parameters"/>
</composite>
</attribute>
<attribute name="template">
<boolean val="false"/>
</attribute>
<attribute name="templates"/>
</object></layer>
</diagram>

View file

@ -0,0 +1,83 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>HappyDoc Generated Documentation</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">HappyDoc Generated Documentation</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<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="Modules and Packages">Modules and Packages</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td valign="top" align="left"><p><a href="mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox.html">CryptoBox</a></p></td><td valign="top" align="left">
<p>This is a secure fileserver with encrypted filesystem and webinterface.</p>
</td></tr>
<tr><td valign="top" align="left"><p><a href="mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer.html">CryptoBoxContainer</a></p></td><td valign="top" align="left"></td></tr>
<tr><td valign="top" align="left"><p><a href="mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger.html">CryptoBoxLogger</a></p></td><td valign="top" align="left">
<p>manages logging events of the CryptoBox</p>
</td></tr>
<tr><td valign="top" align="left"><p><a href="mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences.html">CryptoBoxPreferences</a></p></td><td valign="top" align="left">
<p>read and write configuration</p>
</td></tr>
</table>
</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>

View file

@ -0,0 +1,111 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Module: CryptoBox</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">Module: CryptoBox</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBox.py</font>
</th>
</tr>
<tr>
<td>
<p>This is a secure fileserver with encrypted filesystem and webinterface.</p>
<p>It was originally written in bash/perl. Now a complete rewrite is in
progress. So things might be confusing here. Hopefully not for long.
:)</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="Imported modules">Imported modules</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<b>import</b> <a href="CryptoBoxContainer.html">CryptoBoxContainer</a><br>
<b>import</b> <a href="CryptoBoxLogger.html">CryptoBoxLogger</a><br>
<b>import</b> <a href="CryptoBoxPreferences.html">CryptoBoxPreferences</a><br>
<b>import</b> <a href="http://www.python.org/doc/current/lib/module-re.html">re</a><br>
</td></tr>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Classes">Classes</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td valign="top" align="left"><p><a href="CryptoBox/CryptoBoxProps.html">CryptoBoxProps</a></p></td><td valign="top" align="left">
<p>Get and set the properties of a CryptoBox</p>
</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>

View file

@ -0,0 +1,317 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Class: CryptoBox</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: CryptoBox</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBox.py</font>
</th>
</tr>
<tr>
<td>
<p>Get and set the properties of a CryptoBox</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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<a href="#__allAvailablePartitions">__allAvailablePartitions</a><br>
<a href="#__csv2list">__csv2list</a><br>
<a href="#__deviceIsReallyAllowed">__deviceIsReallyAllowed</a><br>
<a href="#__init__">__init__</a><br>
<a href="#debugMessage">debugMessage</a><br>
<a href="#getConfigValue">getConfigValue</a><br>
<a href="#getContainerList">getContainerList</a><br>
<a href="#setConfigValue">setConfigValue</a><br>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__allAvailablePartitions"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__allAvailablePartitions&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__allAvailablePartitions ( self )
</pre></font>
<p>retrieve a list of all available containers</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__csv2list"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__csv2list&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__csv2list ( self, csvstring )
</pre></font>
<h3>transform a csv preferences string into a list</h3>
<p> internal methods</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__deviceIsReallyAllowed"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__deviceIsReallyAllowed&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__deviceIsReallyAllowed ( self, device )
</pre></font>
<p>return &quot;true&quot; if the given device is white-listed for being used as cryptobox container</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__init__"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__init__&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__init__ ( self )
</pre></font>
<p>reset all variables to default settings</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="debugMessage"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">debugMessage&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
debugMessage (
self,
level,
text,
)
</pre></font>
<h3>print a debug message to the previously choosen debugging facility</h3>
<p> public methods</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="getConfigValue"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">getConfigValue&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
getConfigValue ( self, key )
</pre></font>
<p>return a tuple of key+value from the configfile</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="getContainerList"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">getContainerList&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
getContainerList ( self )
</pre></font>
<p>return a list of all containers of this cryptobox</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="setConfigValue"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">setConfigValue&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
setConfigValue (
self,
key,
value,
)
</pre></font>
<p>save the strings key+value in configfile</p>
</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 11:42:25 2006 by
<a href="http://happydoc.sourceforge.net">HappyDoc</a> version
2.1</i></font>
</body>
</html>

View file

@ -0,0 +1,318 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Class: CryptoBoxProps</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: CryptoBoxProps</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBox.py</font>
</th>
</tr>
<tr>
<td>
<h3>Get and set the properties of a CryptoBox</h3>
<p> This class returns the available <u>and</u> allowed devices, which will
be used further.</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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<a href="#__allAvailablePartitions">__allAvailablePartitions</a><br>
<a href="#__csv2list">__csv2list</a><br>
<a href="#__deviceIsReallyAllowed">__deviceIsReallyAllowed</a><br>
<a href="#__init__">__init__</a><br>
<a href="#debugMessage">debugMessage</a><br>
<a href="#getConfigValue">getConfigValue</a><br>
<a href="#getContainerList">getContainerList</a><br>
<a href="#setConfigValue">setConfigValue</a><br>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__allAvailablePartitions"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__allAvailablePartitions&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__allAvailablePartitions ( self )
</pre></font>
<h3>retrieve a list of all available containers</h3>
<p> TODO: if the code is not like a poem, write prosadocumentation ;)</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__csv2list"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__csv2list&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__csv2list ( self, csvstring )
</pre></font>
<p>transform a csv preferences string into a list</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__deviceIsReallyAllowed"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__deviceIsReallyAllowed&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__deviceIsReallyAllowed ( self, device )
</pre></font>
<p>return &quot;true&quot; if the given device is white-listed for being used as cryptobox container</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__init__"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__init__&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__init__ ( self )
</pre></font>
<p>read config and fill class variables</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="debugMessage"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">debugMessage&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
debugMessage (
self,
level,
text,
)
</pre></font>
<p>print a debug message to the previously choosen debugging facility</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="getConfigValue"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">getConfigValue&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
getConfigValue ( self, key )
</pre></font>
<p>return a tuple of key+value from the configfile</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="getContainerList"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">getContainerList&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
getContainerList ( self )
</pre></font>
<p>return a list of all actual available containers of this cryptobox</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="setConfigValue"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">setConfigValue&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
setConfigValue (
self,
key,
value,
)
</pre></font>
<p>save the strings key+value in configfile</p>
</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>

View file

@ -0,0 +1,76 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Module: CryptoBoxContainer</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">Module: CryptoBoxContainer</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBoxContainer.py</font>
</th>
</tr>
<tr>
<td>
<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="Classes">Classes</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td valign="top" align="left"><p><a href="CryptoBoxContainer/CryptoBoxContainer.html">CryptoBoxContainer</a></p></td><td valign="top" align="left"></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>

View file

@ -0,0 +1,102 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Class: CryptoBoxContainer</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: CryptoBoxContainer</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBoxContainer.py</font>
</th>
</tr>
<tr>
<td>
<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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<a href="#__init__">__init__</a><br>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__init__"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__init__&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__init__ ( self, device )
</pre></font>
</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>

View file

@ -0,0 +1,105 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Module: CryptoBoxLogger</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">Module: CryptoBoxLogger</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBoxLogger.py</font>
</th>
</tr>
<tr>
<td>
<p>manages logging events of the CryptoBox</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="Imported modules">Imported modules</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<b>import</b> <a href="http://www.python.org/doc/current/lib/module-sys.html">sys</a><br>
</td></tr>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Classes">Classes</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td valign="top" align="left"><p><a href="CryptoBoxLogger/CryptoBoxLogger.html">CryptoBoxLogger</a></p></td><td valign="top" align="left">
<p>handles concrete logging events and prints them e.g. to a logfile</p>
</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>

View file

@ -0,0 +1,168 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Class: CryptoBoxLogger</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: CryptoBoxLogger</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBoxLogger.py</font>
</th>
</tr>
<tr>
<td>
<p>handles concrete logging events and prints them e.g. to a logfile</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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<a href="#__init__">__init__</a><br>
<a href="#message2file">message2file</a><br>
<a href="#printMessage">printMessage</a><br>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__init__"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__init__&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__init__ (
self,
level,
facility,
name=None,
)
</pre></font>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="message2file"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">message2file&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
message2file ( self, text )
</pre></font>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="printMessage"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">printMessage&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
printMessage (
self,
text,
msg_level=None,
)
</pre></font>
</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>

View file

@ -0,0 +1,109 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Module: CryptoBoxPreferences</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">Module: CryptoBoxPreferences</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">CryptoBoxPreferences.py</font>
</th>
</tr>
<tr>
<td>
<p>read and write configuration</p>
<p>This Class is derived mainly from <code>gimini</code> project.
Thanx to Dutoit! &lt;dutoitc(at)hotmail.com&gt;</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="Imported modules">Imported modules</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<b>from</b> <a href="http://www.python.org/doc/current/lib/module-ConfigParser.html">ConfigParser</a> <b>import</b> *<br>
<b>import</b> <a href="http://www.python.org/doc/current/lib/module-os.html">os</a><br>
<b>import</b> <a href="http://www.python.org/doc/current/lib/module-sys.html">sys</a><br>
</td></tr>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="Classes">Classes</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="0">
<tr><td valign="top" align="left"><p><a href="CryptoBoxPreferences/Preferences.html">Preferences</a></p></td><td valign="top" align="left">
<p>This class handles preferences and stores them into given configfile</p>
</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>

View file

@ -0,0 +1,275 @@
<!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[&quot;ma_preference&quot;]
- to set a preference :
myPP[&quot;ma_preference&quot;]=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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__getitem__&nbsp;</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 &lt;dutoitc@hotmail.com&gt;</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__init__"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__init__&nbsp;</font>
</th>
</tr>
<tr>
<td>
<font color="#000088"><pre>
__init__ ( self, filename )
</pre></font>
<h3>Constructor</h3>
<p> @author C.Dutoit &lt;dutoitc@hotmail.com&gt;</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__loadConfig"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__loadConfig&nbsp;</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 &lt;dutoitc@hotmail.com&gt;</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__saveConfig"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__saveConfig&nbsp;</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 &lt;dutoitc@hotmail.com&gt;</p>
<tr>
<th bgcolor="#99ccff"
rowspan="2"
valign="top"
align="left"
width="20%"
>
<font color="#000000">
<a name="__setitem__"></a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">__setitem__&nbsp;</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 &lt;dutoitc@hotmail.com&gt;</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>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</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>

View file

@ -0,0 +1,75 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
<title>Module: test</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">Module: test</font>
</th>
<th bgcolor="#88bbee"
width="90%"
align="right"><font color="#000000">test.py</font>
</th>
</tr>
<tr>
<td>
<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="Imported modules">Imported modules</a>&nbsp;
</font>
</th>
<th bgcolor="#99ccff"
valign="top"
align="left"
width="80%"
>
<font color="#000000">&nbsp;</font>
</th>
</tr>
<tr>
<td>
<b>import</b> <a href="CryptoBox.html">CryptoBox</a><br>
</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 11:45:34 2006 by
<a href="http://happydoc.sourceforge.net">HappyDoc</a> version
2.1</i></font>
</body>
</html>

View file

@ -1,9 +0,0 @@
from CryptoBox import CryptoBox
cb = CryptoBox()
#print "Allowed_Devices: %s" % (cb.getConfigValue("allowed_devices"), )
#print "non-existing: %s" % (cb.getConfigValue("alowed_devices"), )
print [e.device for e in cb.getContainerList()]
print "Config %s" % str(cb.getConfigValue("logfile"))
cb.setConfigValue("foo","bar")