descpage: Implement inserting helptext in code
Add helping comments to beginning of gnuplot scripts explaining data source Issue #1 (#1)
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
import pywikibot
|
||||
import mwparserfromhell as mwparser
|
||||
@@ -85,6 +86,13 @@ class DescPageBot(pywikibot.bot.Bot):
|
||||
replace( "system(\"echo $OUTFILE\")",
|
||||
"'{}'".format (os.path.basename( self.job.image ) ) )
|
||||
|
||||
# Locate first empty line
|
||||
m = re.search(r"^\s*$", gnuplot_script, re.MULTILINE)
|
||||
if m:
|
||||
# Insert help lines
|
||||
gnuplot_script = gnuplot_script[:m.end()] +\
|
||||
Config.gnuplot_script_help + gnuplot_script[m.end():]
|
||||
|
||||
return gnuplot_script
|
||||
|
||||
def parse_page(self):
|
||||
|
||||
Reference in New Issue
Block a user