Przeglądaj źródła

redfam: Make get_disc_link() able to return wikilink

Issue #64 (https://git.golderweb.de/wiki/jogobot-red/issues/64)
develop
Jonathan Golder 6 lat temu
rodzic
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.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 ):
"""

Ładowanie…
Anuluj
Zapisz