diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-11-05 15:52:21 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-11-05 15:52:21 +0100 |
commit | f224ef451ecceafe7c47e3469cd0f8a4b6505c78 (patch) | |
tree | 215c2fe4e720455ffe50ef886e51b8994b0c675b /helpcontent2/to-wiki/wikiconv2.py | |
parent | 520121f9cfc67e5fe3a24e8fae1a9c78bb22c8b7 (diff) |
Make the heading actually work. Empty line between paragraphs.
Diffstat (limited to 'helpcontent2/to-wiki/wikiconv2.py')
-rwxr-xr-x | helpcontent2/to-wiki/wikiconv2.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py index fbd3cb9198..27d91edafc 100755 --- a/helpcontent2/to-wiki/wikiconv2.py +++ b/helpcontent2/to-wiki/wikiconv2.py @@ -302,8 +302,6 @@ class clink: text = "["+self.link+" "+self.wikitext+"]" else: text = "[["+self.lname+"|"+self.wikitext+"]]" - if self.parent.heading: - text = heading(self.parent.depth) + " " + text + " "+heading(self.parent.depth) text = replace_text(text) return text @@ -427,10 +425,6 @@ class cparagraph: print text.encode('ascii','replace') return - # mark this as the heading - if self.objects.len() > 0 and self.heading: - print heading(self.depth) - for i in self.objects: try: raise i @@ -446,11 +440,11 @@ class cparagraph: if len(self.wikitext): print self.wikitext - # end of the heading mark - if self.objects.len() > 0 and self.heading: - print heading(self.depth) - def get_all(self): + # mark this as the heading + if len(self.objects) > 0 and self.heading: + self.wikitext = self.wikitext + heading(self.depth) + " " + for i in self.objects: try: raise i @@ -462,6 +456,15 @@ class cparagraph: if len(self.wikitext): self.wikitext = self.wikitext + "\n" self.wikitext = self.wikitext + "\n" + i.get_all() + + # end of the heading mark + if len(self.objects) > 0 and self.heading: + self.wikitext = self.wikitext + " " + heading(self.depth) + + # write an additional \n at the end of paragraph + if len(self.objects) > 0: + self.wikitext = self.wikitext + "\n" + return self.wikitext def get_curobj(self): @@ -498,7 +501,7 @@ def loadallfiles(filename): titles.append(title) def signal_handler(signal, frame): - sys.snderr.write( "You pressed Ctrl+C!" ) + sys.stderr.write( "Exiting..." ) sys.exit(1) signal.signal(signal.SIGINT, signal_handler) |