From 9cab5683121b8310196687861013daf2a2752af0 Mon Sep 17 00:00:00 2001 From: age Date: Wed, 16 Aug 2006 11:07:57 +0000 Subject: [PATCH] cleaned up; used happdoc --- pythonrewrite/bin2/CryptoBox.py | 65 ++- pythonrewrite/bin2/CryptoBoxContainer.py | 7 + pythonrewrite/bin2/CryptoBoxLogger.py | 6 + pythonrewrite/bin2/CryptoBoxPreferences.py | 29 +- pythonrewrite/bin2/classes.txt | 10 +- pythonrewrite/bin2/doc/dia.dia | 377 ++++++++++++++++++ pythonrewrite/bin2/doc/index.html | 83 ++++ .../pythonrewrite/bin2/doc/CryptoBox.html | 111 ++++++ .../bin2/doc/CryptoBox/CryptoBox.html | 317 +++++++++++++++ .../bin2/doc/CryptoBox/CryptoBoxProps.html | 318 +++++++++++++++ .../bin2/doc/CryptoBoxContainer.html | 76 ++++ .../CryptoBoxContainer.html | 102 +++++ .../bin2/doc/CryptoBoxLogger.html | 105 +++++ .../doc/CryptoBoxLogger/CryptoBoxLogger.html | 168 ++++++++ .../bin2/doc/CryptoBoxPreferences.html | 109 +++++ .../doc/CryptoBoxPreferences/Preferences.html | 275 +++++++++++++ .../branches/pythonrewrite/bin2/doc/test.html | 75 ++++ pythonrewrite/bin2/test.py | 9 - 18 files changed, 2190 insertions(+), 52 deletions(-) create mode 100644 pythonrewrite/bin2/doc/dia.dia create mode 100644 pythonrewrite/bin2/doc/index.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBox.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBoxProps.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer/CryptoBoxContainer.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger/CryptoBoxLogger.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences/Preferences.html create mode 100644 pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/test.html delete mode 100644 pythonrewrite/bin2/test.py diff --git a/pythonrewrite/bin2/CryptoBox.py b/pythonrewrite/bin2/CryptoBox.py index f09930b..913e1e3 100644 --- a/pythonrewrite/bin2/CryptoBox.py +++ b/pythonrewrite/bin2/CryptoBox.py @@ -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") diff --git a/pythonrewrite/bin2/CryptoBoxContainer.py b/pythonrewrite/bin2/CryptoBoxContainer.py index 6e0a4cb..f71fe9f 100644 --- a/pythonrewrite/bin2/CryptoBoxContainer.py +++ b/pythonrewrite/bin2/CryptoBoxContainer.py @@ -1,6 +1,13 @@ +''' +TODO +''' class CryptoBoxContainer: + ''' + TODO + ''' def __init__(self, device): self.device = device + diff --git a/pythonrewrite/bin2/CryptoBoxLogger.py b/pythonrewrite/bin2/CryptoBoxLogger.py index 0d69b0c..90268bc 100644 --- a/pythonrewrite/bin2/CryptoBoxLogger.py +++ b/pythonrewrite/bin2/CryptoBoxLogger.py @@ -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} diff --git a/pythonrewrite/bin2/CryptoBoxPreferences.py b/pythonrewrite/bin2/CryptoBoxPreferences.py index 0bc6135..03d83f6 100644 --- a/pythonrewrite/bin2/CryptoBoxPreferences.py +++ b/pythonrewrite/bin2/CryptoBoxPreferences.py @@ -1,22 +1,20 @@ #!/usr/bin/env python -""" -This Class is derived mainly from 'gimini' project. - __version__ = "$Revision: 1.1 $" - __author__ = "C.Dutoit " - __date__ = "2003-2-14" +''' +read and write configuration -Thanx to Dutoit! -""" +This Class is derived mainly from 'gimini' project. +Thanx to Dutoit! +''' 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 """ + self.prefsfilename = filename self._config = None self.__loadConfig() @@ -91,7 +90,7 @@ class Preferences: @since 1.1.2.5 @author C.Dutoit """ - 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) #>-------------------------------------------------------------------------- diff --git a/pythonrewrite/bin2/classes.txt b/pythonrewrite/bin2/classes.txt index ece33f1..ceca63b 100644 --- a/pythonrewrite/bin2/classes.txt +++ b/pythonrewrite/bin2/classes.txt @@ -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 diff --git a/pythonrewrite/bin2/doc/dia.dia b/pythonrewrite/bin2/doc/dia.dia new file mode 100644 index 0000000..9cd3804 --- /dev/null +++ b/pythonrewrite/bin2/doc/dia.dia @@ -0,0 +1,377 @@ + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #HappyDoc Generated Documentation# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Preferences# + + + + + + + + + + + + + + + + + + + + + + + #__getitem__# + + + + + + + + #__init__# + + + + + + + + #__loadConfig# + + + + + + + + #__saveConfig# + + + + + + + + #__setitem__# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #CryptoBoxLogger# + + + + + + + + + + + + + + + + + + + + + + + #__init__# + + + + + + + + #message2file# + + + + + + + + #printMessage# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #CryptoBoxProps# + + + + + + + + + + + + + + + + + + + + + + + #__allAvailablePartitions# + + + + + + + + #__csv2list# + + + + + + + + #__deviceIsReallyAllowed# + + + + + + + + #__init__# + + + + + + + + #debugMessage# + + + + + + + + #getConfigValue# + + + + + + + + #getContainerList# + + + + + + + + #setConfigValue# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #CryptoBoxContainer# + + + + + + + + + + + + + + + + + + + + + + + #__init__# + + + + + + + + + + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/index.html b/pythonrewrite/bin2/doc/index.html new file mode 100644 index 0000000..e2c7616 --- /dev/null +++ b/pythonrewrite/bin2/doc/index.html @@ -0,0 +1,83 @@ + + + + + + HappyDoc Generated Documentation + + + + +

Table of Contents

+ + + + + + + + + +
HappyDoc Generated Documentation +   +
+ + + + + + + + +
+ + Modules and Packages  + + +   +
+ + + + + + +

CryptoBox

+

This is a secure fileserver with encrypted filesystem and webinterface.

+

CryptoBoxContainer

CryptoBoxLogger

+

manages logging events of the CryptoBox

+

CryptoBoxPreferences

+

read and write configuration

+
+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox.html new file mode 100644 index 0000000..2c44a8b --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox.html @@ -0,0 +1,111 @@ + + + + + + Module: CryptoBox + + + + +

Table of Contents

+ + + + + + + + + +
Module: CryptoBox + CryptoBox.py +
+ +

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. +:)

+ + + + + + + + + + + + + + + + +
+ + Imported modules  + + +   +
+ +import CryptoBoxContainer
+import CryptoBoxLogger
+import CryptoBoxPreferences
+import re
+ +
+ + Classes  + + +   +
+ + + +

CryptoBoxProps

+

Get and set the properties of a CryptoBox

+
+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBox.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBox.html new file mode 100644 index 0000000..9e097d9 --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBox.html @@ -0,0 +1,317 @@ + + + + + + Class: CryptoBox + + + + +

Table of Contents

+ + + + + + + + + +
Class: CryptoBox + CryptoBox.py +
+ +

Get and set the properties of a CryptoBox

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Methods  + + +   +
+ +__allAvailablePartitions
+__csv2list
+__deviceIsReallyAllowed
+__init__
+debugMessage
+getConfigValue
+getContainerList
+setConfigValue
+ + +
+ +   + + + __allAvailablePartitions  +
+
+__allAvailablePartitions ( self )
+
+
+ +

retrieve a list of all available containers

+ +
+ +   + + + __csv2list  +
+
+__csv2list ( self,  csvstring )
+
+
+ +

transform a csv preferences string into a list

+

internal methods

+ +
+ +   + + + __deviceIsReallyAllowed  +
+
+__deviceIsReallyAllowed ( self,  device )
+
+
+ +

return "true" if the given device is white-listed for being used as cryptobox container

+ +
+ +   + + + __init__  +
+
+__init__ ( self )
+
+
+ +

reset all variables to default settings

+ +
+ +   + + + debugMessage  +
+
+debugMessage (
+        self,
+        level,
+        text,
+        )
+
+
+ +

print a debug message to the previously choosen debugging facility

+

public methods

+ +
+ +   + + + getConfigValue  +
+
+getConfigValue ( self,  key )
+
+
+ +

return a tuple of key+value from the configfile

+ +
+ +   + + + getContainerList  +
+
+getContainerList ( self )
+
+
+ +

return a list of all containers of this cryptobox

+ +
+ +   + + + setConfigValue  +
+
+setConfigValue (
+        self,
+        key,
+        value,
+        )
+
+
+ +

save the strings key+value in configfile

+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 11:42:25 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBoxProps.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBoxProps.html new file mode 100644 index 0000000..402dcd7 --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBox/CryptoBoxProps.html @@ -0,0 +1,318 @@ + + + + + + Class: CryptoBoxProps + + + + +

Table of Contents

+ + + + + + + + + +
Class: CryptoBoxProps + CryptoBox.py +
+ +

Get and set the properties of a CryptoBox

+

This class returns the available and allowed devices, which will + be used further.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Methods  + + +   +
+ +__allAvailablePartitions
+__csv2list
+__deviceIsReallyAllowed
+__init__
+debugMessage
+getConfigValue
+getContainerList
+setConfigValue
+ + +
+ +   + + + __allAvailablePartitions  +
+
+__allAvailablePartitions ( self )
+
+
+ +

retrieve a list of all available containers

+

TODO: if the code is not like a poem, write prosadocumentation ;)

+ +
+ +   + + + __csv2list  +
+
+__csv2list ( self,  csvstring )
+
+
+ +

transform a csv preferences string into a list

+ +
+ +   + + + __deviceIsReallyAllowed  +
+
+__deviceIsReallyAllowed ( self,  device )
+
+
+ +

return "true" if the given device is white-listed for being used as cryptobox container

+ +
+ +   + + + __init__  +
+
+__init__ ( self )
+
+
+ +

read config and fill class variables

+ +
+ +   + + + debugMessage  +
+
+debugMessage (
+        self,
+        level,
+        text,
+        )
+
+
+ +

print a debug message to the previously choosen debugging facility

+ +
+ +   + + + getConfigValue  +
+
+getConfigValue ( self,  key )
+
+
+ +

return a tuple of key+value from the configfile

+ +
+ +   + + + getContainerList  +
+
+getContainerList ( self )
+
+
+ +

return a list of all actual available containers of this cryptobox

+ +
+ +   + + + setConfigValue  +
+
+setConfigValue (
+        self,
+        key,
+        value,
+        )
+
+
+ +

save the strings key+value in configfile

+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer.html new file mode 100644 index 0000000..05113f1 --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer.html @@ -0,0 +1,76 @@ + + + + + + Module: CryptoBoxContainer + + + + +

Table of Contents

+ + + + + + + + + +
Module: CryptoBoxContainer + CryptoBoxContainer.py +
+ + + + + + + + + + +
+ + Classes  + + +   +
+ + + +

CryptoBoxContainer

+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer/CryptoBoxContainer.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer/CryptoBoxContainer.html new file mode 100644 index 0000000..4be7f55 --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxContainer/CryptoBoxContainer.html @@ -0,0 +1,102 @@ + + + + + + Class: CryptoBoxContainer + + + + +

Table of Contents

+ + + + + + + + + +
Class: CryptoBoxContainer + CryptoBoxContainer.py +
+ + + + + + + + + + + + + + + +
+ + Methods  + + +   +
+ +__init__
+ + +
+ +   + + + __init__  +
+
+__init__ ( self,  device )
+
+
+ +
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger.html new file mode 100644 index 0000000..7e683ec --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger.html @@ -0,0 +1,105 @@ + + + + + + Module: CryptoBoxLogger + + + + +

Table of Contents

+ + + + + + + + + +
Module: CryptoBoxLogger + CryptoBoxLogger.py +
+ +

manages logging events of the CryptoBox

+ + + + + + + + + + + + + + + + +
+ + Imported modules  + + +   +
+ +import sys
+ +
+ + Classes  + + +   +
+ + + +

CryptoBoxLogger

+

handles concrete logging events and prints them e.g. to a logfile

+
+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger/CryptoBoxLogger.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger/CryptoBoxLogger.html new file mode 100644 index 0000000..1215bb6 --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxLogger/CryptoBoxLogger.html @@ -0,0 +1,168 @@ + + + + + + Class: CryptoBoxLogger + + + + +

Table of Contents

+ + + + + + + + + +
Class: CryptoBoxLogger + CryptoBoxLogger.py +
+ +

handles concrete logging events and prints them e.g. to a logfile

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + Methods  + + +   +
+ +__init__
+message2file
+printMessage
+ + +
+ +   + + + __init__  +
+
+__init__ (
+        self,
+        level,
+        facility,
+        name=None,
+        )
+
+
+ + +
+ +   + + + message2file  +
+
+message2file ( self,  text )
+
+
+ + +
+ +   + + + printMessage  +
+
+printMessage (
+        self,
+        text,
+        msg_level=None,
+        )
+
+
+ +
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences.html new file mode 100644 index 0000000..2a8488f --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences.html @@ -0,0 +1,109 @@ + + + + + + Module: CryptoBoxPreferences + + + + +

Table of Contents

+ + + + + + + + + +
Module: CryptoBoxPreferences + CryptoBoxPreferences.py +
+ +

read and write configuration

+

This Class is derived mainly from gimini project. +Thanx to Dutoit! <dutoitc(at)hotmail.com>

+ + + + + + + + + + + + + + + + +
+ + Imported modules  + + +   +
+ +from ConfigParser import *
+import os
+import sys
+ +
+ + Classes  + + +   +
+ + + +

Preferences

+

This class handles preferences and stores them into given configfile

+
+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences/Preferences.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences/Preferences.html new file mode 100644 index 0000000..7a764f8 --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/CryptoBoxPreferences/Preferences.html @@ -0,0 +1,275 @@ + + + + + + Class: Preferences + + + + +

Table of Contents

+ + + + + + + + + +
Class: Preferences + CryptoBoxPreferences.py +
+ +

This class handles preferences and stores them into given configfile

+

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

+

The preferences are automatically loaded on the first instanciation of this + class and are saved when a value is added or changed automatically, too.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Methods  + + +   +
+ +__getitem__
+__init__
+__loadConfig
+__saveConfig
+__setitem__
+ + +
+ +   + + + __getitem__  +
+
+__getitem__ ( self,  name )
+
+
+ +

Return the preferences for the given item

+

@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>

+ +
+ +   + + + __init__  +
+
+__init__ ( self,  filename )
+
+
+ +

Constructor

+

@author C.Dutoit <dutoitc@hotmail.com>

+ +
+ +   + + + __loadConfig  +
+
+__loadConfig ( self )
+
+
+ +

Load datas from config file

+

@since 1.1.2.5 + @author C.Dutoit <dutoitc@hotmail.com>

+ +
+ +   + + + __saveConfig  +
+
+__saveConfig ( self )
+
+
+ +

Save datas to config file

+

@since 1.1.2.5 + @author C.Dutoit <dutoitc@hotmail.com>

+ +
+ +   + + + __setitem__  +
+
+__setitem__ (
+        self,
+        name,
+        value,
+        )
+
+
+ +

Return the preferences for the given item

+

@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>

+ + + + + + + + +
+ + Exceptions  + + +   +
+ +TypeError, "Name cannot contain a space"
+ +
+
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 13:00:54 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/test.html b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/test.html new file mode 100644 index 0000000..9bd8abf --- /dev/null +++ b/pythonrewrite/bin2/doc/mnt/phobos/age/svn/cryptobox/branches/pythonrewrite/bin2/doc/test.html @@ -0,0 +1,75 @@ + + + + + + Module: test + + + + +

Table of Contents

+ + + + + + + + + +
Module: test + test.py +
+ + + + + + + + + + +
+ + Imported modules  + + +   +
+ +import CryptoBox
+ +
+ +
+ +
+ +

Table of Contents

+ + This document was automatically generated + on Wed Aug 16 11:45:34 2006 by + HappyDoc version + 2.1 + + + + \ No newline at end of file diff --git a/pythonrewrite/bin2/test.py b/pythonrewrite/bin2/test.py deleted file mode 100644 index b690388..0000000 --- a/pythonrewrite/bin2/test.py +++ /dev/null @@ -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") -