changeset 6:633ebfcff0d0

Add a method to request a Document ID
author Benoît Allard <benoit.allard@greenbone.net>
date Mon, 06 Oct 2014 11:39:59 +0200
parents d62264a643fb
children c924c15bd110
files CHANGES farolluz/cvrf.py
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Mon Oct 06 11:39:38 2014 +0200
+++ b/CHANGES	Mon Oct 06 11:39:59 2014 +0200
@@ -1,3 +1,17 @@
+FarolLuz 0.1.1 (????-??-??)
+===========================
+
+This is the first patch release of FarolLuz 0.1
+
+This release add support for reading / writing incomplete CVRF documents.
+
+Main changes since FarolLuz 0.1:
+--------------------------------
+* Allow writing of incomplete CVRF documents.
+* Allow parsing of incomplete CVRF documents.
+* Add a method to extract a document ID.
+
+
 FarolLuz 0.1 (2014-09-23)
 =========================
 
--- a/farolluz/cvrf.py	Mon Oct 06 11:39:38 2014 +0200
+++ b/farolluz/cvrf.py	Mon Oct 06 11:39:59 2014 +0200
@@ -65,6 +65,9 @@
     def addAlias(self, alias):
         self._aliases.append(alias)
 
+    def getId(self):
+        return self._id
+
     def validate(self):
         if not self._id:
             raise ValidationError('Document ID cannot be left empty')
@@ -92,6 +95,9 @@
     def setGenerator(self, generator):
         self._generator = generator
 
+    def getId(self):
+        return self._identification.getId()
+
     def validate(self):
         if self._identification is None:
             raise ValidationError('Document Tracking needs to have an Identification')
@@ -978,6 +984,12 @@
                 return note
         return None
 
+    def getDocId(self):
+        if self._tracking is not None:
+            return self._tracking.getId()
+        # Make up something ...
+        return self._title.lower()
+
     def validate(self):
         if not self._title:
             raise ValidationError('Document Title cannot be empty')
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)