Merge branch 'fs#29-generate-articledisc-notice' into fs#25-mark-done
This commit is contained in:
@@ -487,6 +487,50 @@ class RedFamWorker( RedFam ):
|
|||||||
return ( self.redpagetitle + "#" +
|
return ( self.redpagetitle + "#" +
|
||||||
str(anchor_code).strip() )
|
str(anchor_code).strip() )
|
||||||
|
|
||||||
|
def generate_disc_notice_template( self ):
|
||||||
|
"""
|
||||||
|
Generates notice template to add on discussion Pages of Articles when
|
||||||
|
redundancy discussion is finished
|
||||||
|
|
||||||
|
@return Notice template to add on article disc
|
||||||
|
@rtype wikicode-node
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Generate template boilerplate
|
||||||
|
template = mwparser.nodes.template.Template(
|
||||||
|
jogobot.config['redundances']['disc_notice_template_name'])
|
||||||
|
|
||||||
|
# Index of first article's param
|
||||||
|
param_cnt = 3
|
||||||
|
|
||||||
|
# Iterate over articles in redfam
|
||||||
|
for article in self._articlesList:
|
||||||
|
# Make sure to only use 8 articles (max. param 10)
|
||||||
|
if param_cnt > 10:
|
||||||
|
break
|
||||||
|
|
||||||
|
# Add param for article
|
||||||
|
template.add( param_cnt, article, True )
|
||||||
|
|
||||||
|
param_cnt += 1
|
||||||
|
|
||||||
|
# Add begin
|
||||||
|
template.add( "Beginn", self._mysql.data[ 'beginning' ].strftime(
|
||||||
|
"%d. %B %Y").lstrip("0"), True )
|
||||||
|
|
||||||
|
# Add end
|
||||||
|
template.add( "Ende", self._mysql.data[ 'ending' ].strftime(
|
||||||
|
"%d. %B %Y").lstrip("0"), True )
|
||||||
|
|
||||||
|
# Add link to related reddisc
|
||||||
|
template.add( "Diskussion", self.get_disc_link(), True )
|
||||||
|
|
||||||
|
# Add signature and timestamp
|
||||||
|
# Not used atm
|
||||||
|
# template.add( 1, "-- ~~~~", True )
|
||||||
|
|
||||||
|
return template
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def list_by_status( cls, status ):
|
def list_by_status( cls, status ):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user