diff --git a/lib/redfam.py b/lib/redfam.py index 37162c4..4da1ea4 100644 --- a/lib/redfam.py +++ b/lib/redfam.py @@ -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 ): """