Add a method to get link to related reddisc
To generate notices or other stuff it is necessary to add links to the related reddisc. This method returns a wikilink to text the redfam's reddisc. Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=81 FS#81] Related Task: [https://fs.golderweb.de/index.php?do=details&task_id=81 FS#81]
This commit is contained in:
@@ -462,6 +462,31 @@ class RedFamWorker( RedFam ):
|
||||
|
||||
self._status = 3
|
||||
|
||||
def get_disc_link( self ):
|
||||
"""
|
||||
Constructs and returns the link to Redundancy discussion
|
||||
|
||||
@returns Link to diskussion
|
||||
@rtype str
|
||||
"""
|
||||
|
||||
# We need to Replace Links with their linktext
|
||||
anchor_code = mwparser.parse( self._mysql.data[ 'heading' ].strip() )
|
||||
for link in anchor_code.ifilter_wikilinks():
|
||||
if link.text:
|
||||
text = link.text
|
||||
else:
|
||||
text = link.title
|
||||
|
||||
anchor_code.replace( link, text )
|
||||
|
||||
# Whitespace is replaced with underscores
|
||||
anchor_code.replace( " ", "_" )
|
||||
|
||||
# We try it with out any more parsing as mw will do while parsing page
|
||||
return ( self.redpagetitle + "#" +
|
||||
str(anchor_code).strip() )
|
||||
|
||||
@classmethod
|
||||
def list_by_status( cls, status ):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user