Browse Source

redfam: Make get_disc_link() able to return wikilink

Issue #64 (https://git.golderweb.de/wiki/jogobot-red/issues/64)
develop
Jonathan Golder 6 years ago
parent
commit
389c48605e
  1. 12
      lib/redfam.py

12
lib/redfam.py

@ -652,10 +652,13 @@ class RedFamWorker( RedFam ):
self.status.remove("note_rej") self.status.remove("note_rej")
self.status.add( "marked" ) 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 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 @returns Link to diskussion
@rtype str @rtype str
""" """
@ -675,7 +678,12 @@ class RedFamWorker( RedFam ):
anchor_code = mwparser.parse( anchor_code ).strip_code() anchor_code = mwparser.parse( anchor_code ).strip_code()
# We try it without any more parsing as mw will do while parsing page # 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 ): def disc_section_exists( self ):
""" """

Loading…
Cancel
Save