Newbie at hacking the code!
Running 5.1.2 and linux mint
I want to add another download option to the Narrative web report and hacked the download.py to add another section for dlfname3 , thus;
# if download filename #3, show it???
if dlfname3:
# begin row #3
trow = Html("tr", id='Row03')
tbody += trow
fname = os.path.basename(dlfname3)
tcell = Html("td", class_="ColumnFilename") + (
Html("a", fname, href=dlfname3,
title=html_escape(dldescr3))
)
trow += tcell
dldescr3 = dldescr3 or " "
trow += Html("td", dldescr3,
class_="ColumnDescription", inline=True)
tcell = Html("td", id='Col04',
class_="ColumnModified", inline=True)
trow += tcell
if os.path.exists(dlfname3):
modified = os.stat(dlfname3).st_mtime
last_mod = datetime.datetime.fromtimestamp(modified)
tcell += last_mod
else:
tcell += " "
and declared it below so all three sections (one for each file) seem like they are identical, thus
# download and description #3
dlfname3 = self.report.dl_fname3
dldescr3 = self.report.dl_descr3
I then added the two additional command line input variables to the bash script I normally run, thus;
dl_descr3=DNA traceability2 graph,
down_fname3=Geraldinia-MillstreetDNA-FamilyLines-$(date +â%Fâ).pdf,\
But I guess the parser of the command line script cannot digest these additional inputs and pass them to the program so when I run it I get;
Traceback (most recent call last):
File â/usr/lib/python3/dist-packages/gramps/cli/plug/init.pyâ, line 702, in cl_report
my_report.write_report()
File â/usr/lib/python3/dist-packages/gramps/plugins/webreport/narrativeweb.pyâ, line 408, in write_report
self.base_pages()
File â/usr/lib/python3/dist-packages/gramps/plugins/webreport/narrativeweb.pyâ, line 1241, in base_pages
DownloadPage(self, self.title)
File â/usr/lib/python3/dist-packages/gramps/plugins/webreport/download.pyâ, line 91, in init
dlfname3 = self.report.dl_fname3
AttributeError: âNavWebReportâ object has no attribute âdl_fname3â
Cleaning up.
Can some kind soul point me where I should patch the command-line parser correctly.
Of course if this is not all I need to accomplish then advise as well please.
Stay safe and healthy!
brian