Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2014-04-19 19:13:05 +0200
committerArthur de Jong <arthur@arthurdejong.org>2014-04-19 21:54:06 +0200
commit6becc615b36cd7a3f887563248425145bf9e8bb4 (patch)
treecd8154fbfafa912ac6c4c1235132390ccec1ab52
parent1d42fbc57ca2e08e53d95baf2f6a832435455aa7 (diff)
Provide pskc.parse docstrings
This documents most of the API of the parsing functions and the PSKC class.
-rw-r--r--pskc/parse.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/pskc/parse.py b/pskc/parse.py
index a0a28a7..e5818b8 100644
--- a/pskc/parse.py
+++ b/pskc/parse.py
@@ -18,6 +18,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
+"""Module for parsing PSKC files.
+
+This module provides the PSKC class and some utility functions for parsing
+PSKC files.
+"""
+
+
from xml.etree import ElementTree
@@ -59,6 +66,16 @@ def g_e_d(tree, match):
class PSKC(object):
+ """Wrapper module for parsing a PSKC file.
+
+ Instances of this class provide the following attributes:
+
+ version: the PSKC format version used (1.0)
+ id: identifier
+ encryption: information on used encryption (Encryption instance)
+ mac: information on used MAC method (MAC instance)
+ keys: list of keys (Key instances)
+ """
def __init__(self, filename):
from pskc.encryption import Encryption
@@ -78,5 +95,6 @@ class PSKC(object):
'pskc:MACMethod', namespaces=namespaces))
# handle KeyPackage entries
self.keys = []
- for package in container.findall('pskc:KeyPackage', namespaces=namespaces):
+ for package in container.findall(
+ 'pskc:KeyPackage', namespaces=namespaces):
self.keys.append(Key(self, package))