Browse Source

redfam: Make get_disc_link() able to return wikilink

Issue #64 (https://git.golderweb.de/wiki/jogobot-red/issues/64)
tags/v1.2^2
Jonathan Golder 1 year ago
parent
commit
389c48605e
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      lib/redfam.py

+ 10
- 2
lib/redfam.py View File

@@ -652,10 +652,13 @@ class RedFamWorker( RedFam ):
self.status.remove("note_rej")
self.status.add( "marked" )

def get_disc_link( self ):
def get_disc_link( self, as_link=False ):
"""
Constructs and returns the link to Redundancy discussion

@param as_link If true, wrap link in double square brackets (wikilink)
@type as_link bool

@returns Link to diskussion
@rtype str
"""
@@ -675,7 +678,12 @@ class RedFamWorker( RedFam ):
anchor_code = mwparser.parse( anchor_code ).strip_code()

# We try it without any more parsing as mw will do while parsing page
return ( self.redpage.pagetitle + "#" + anchor_code.strip() )
link = self.redpage.pagetitle + "#" + anchor_code.strip()

if as_link:
return "[[{0}]]".format(link)
else:
return link

def disc_section_exists( self ):
"""


Loading…
Cancel
Save