Subject: [xml2rfc] patch for private memo xml2rfc

From: Leif Johansson <[email-masked]>
Date: Wed, 02 Oct 2013 01:09:09 +0200

support for the private PI in xml2rfc

can be improved on, but its a start

        Cheers Leif
--- /tmp/base.py	2013-10-01 23:56:25.343161064 +0200
+++ writers/base.py	2013-10-02 00:52:04.000000000 +0200
@@ -523,24 +523,23 @@
         """ Returns a lines of lines for the top left header """
         lines = []
         # Document stream / workgroup
-        if not self.pis['private']:
-            if self.draft:
-                workgroup = self.r.find('front/workgroup')
-                if workgroup is not None and workgroup.text:
-                    lines.append(workgroup.text)
-                else:
-                    lines.append(self.boilerplate['draft_workgroup'])
+        if self.draft:
+            workgroup = self.r.find('front/workgroup')
+            if workgroup is not None and workgroup.text:
+                lines.append(workgroup.text)
             else:
-                # Determine 'workgroup' from submissionType
-                subtype = self.r.attrib.get('submissionType', 
-                                             self.defaults['submissionType'])
-                docstream = self.boilerplate['document_stream'].get(subtype)
-                lines.append(docstream)
+                lines.append(self.boilerplate['draft_workgroup'])
+        else:
+            # Determine 'workgroup' from submissionType
+            subtype = self.r.attrib.get('submissionType', 
+                                         self.defaults['submissionType'])
+            docstream = self.boilerplate['document_stream'].get(subtype)
+            lines.append(docstream)
 
         # RFC number
         if not self.draft:
             lines.append('Request for Comments: ' + self.rfcnumber)
-        elif not self.pis['private']:
+        else:
             lines.append('Internet-Draft')
 
         # Series number
@@ -570,7 +569,7 @@
             xml2rfc.log.warn('No category specified for document.')
 
         # Expiration notice for drafts
-        if self.expire_string and not self.pis['private']:
+        if self.expire_string:
             lines.append('Expires: ' + self.expire_string)
 
         # ISSN identifier
@@ -1005,15 +1004,14 @@
             for t in note.findall('t'):
                 self.write_t_rec(t)
 
-        if not self.pis['private']:
-            # Verify that 'ipr' attribute is valid before continuing
-            self._validate_ipr()
+        # Verify that 'ipr' attribute is valid before continuing
+        self._validate_ipr()
 
-            # "Status of this Memo" section
-            self.write_status_section()
+        # "Status of this Memo" section
+        self.write_status_section()
 
-            # Copyright section
-            self.write_copyright()
+        # Copyright section
+        self.write_copyright()
 
         # Insert the table of contents marker at this position
         toc_enabled = self.pis['toc']
--- /tmp/paginated_txt.py	2013-10-01 23:56:25.343161064 +0200
+++ writers/paginated_txt.py	2013-10-02 00:52:04.000000000 +0200
@@ -116,13 +116,10 @@
         self.break_hints = {}
         self.heading_marks = {}
 
-        if self.pis['private']:
-            self.left_header = ""
+        if self.draft:
+            self.left_header = 'Internet-Draft'
         else:
-            if self.draft:
-                self.left_header = 'Internet-Draft'
-            else:
-                self.left_header = 'RFC %s' % self.r.attrib.get('number', '')
+            self.left_header = 'RFC %s' % self.r.attrib.get('number', '')
         title = self.r.find('front/title')
         if title is not None:
             self.center_header = title.attrib.get('abbrev', title.text)