[PATCH 07 of 54] Add a method to request a Document ID

Wald Commits scm-commit at wald.intevation.org
Wed Jan 7 10:56:24 CET 2015


# HG changeset patch
# User Benoît Allard <benoit.allard at greenbone.net>
# Date 1412588399 -7200
# Node ID 633ebfcff0d0fec6f13e5de80b92a0f574dd2800
# Parent  d62264a643fbafed8fae3db68ace686e0502e3ed
Add a method to request a Document ID

diff -r d62264a643fb -r 633ebfcff0d0 CHANGES
--- 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)
 =========================
 
diff -r d62264a643fb -r 633ebfcff0d0 farolluz/cvrf.py
--- 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')


More information about the Farol-commits mailing list