From 4d29da7f3d12f32a32b3c0518aa7f5c21bb8cc19 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Fri, 28 Mar 2025 12:22:55 +0000 Subject: [PATCH] Correct links to mailstats webpage, add -q to pip3 in spec --- root/opt/mailstats/templates/mailstats.html.pt | 6 +++--- root/usr/bin/mailstats.py | 6 ++++-- smeserver-mailstats.spec | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/root/opt/mailstats/templates/mailstats.html.pt b/root/opt/mailstats/templates/mailstats.html.pt index 683f7d8..d67a085 100644 --- a/root/opt/mailstats/templates/mailstats.html.pt +++ b/root/opt/mailstats/templates/mailstats.html.pt @@ -39,9 +39,9 @@
+ Previous + + Next

${structure:title}


diff --git a/root/usr/bin/mailstats.py b/root/usr/bin/mailstats.py index 578e959..3b4e512 100644 --- a/root/usr/bin/mailstats.py +++ b/root/usr/bin/mailstats.py @@ -1136,8 +1136,9 @@ if __name__ == "__main__": ConfigDB = read_config_file(db_dir+"configuration") DomainName = get_value(ConfigDB, "DomainName", "type") #'bjsystems.co.uk' # $cdb->get('DomainName')->value; + SystemName = get_value(ConfigDB, "SystemName", "type") - hello_string = "Mailstats:"+Mailstats_version+' for '+DomainName+" for "+analysis_date+" Printed at:"+formatted_datetime + hello_string = "Mailstats:"+Mailstats_version+' for '+SystemName+"."+DomainName+" for "+analysis_date+" Printed at:"+formatted_datetime print(hello_string) version_string = "Chameleon:"+chameleon_version+" Python:"+python_version if isThonny: @@ -1687,6 +1688,7 @@ if __name__ == "__main__": PreviousDate=previous_date_str, NextDate=next_date_str, DomainName=DomainName, + SystemName=SystemName ) except Exception as e: print(f"Chameleon template Exception {e}") @@ -1783,7 +1785,7 @@ if __name__ == "__main__": filepath = html_page_dir+"mailstats_for_"+analysis_date+".html" html_content = read_html_from_file(filepath) # Replace the Navigation by a "See in browser" prompt - replace_str = f"
See in browser
" + replace_str = f"
See in browser
" html_content = replace_between(html_content, "
", ">Next
", replace_str) if not noemailfile: # Write out the email html to a web page diff --git a/smeserver-mailstats.spec b/smeserver-mailstats.spec index 0beb8b4..5419adf 100644 --- a/smeserver-mailstats.spec +++ b/smeserver-mailstats.spec @@ -124,13 +124,13 @@ sed -i "s|__BUILD_DATE_TIME__|$now|" $RPM_BUILD_ROOT/usr/bin/mailstats.py /sbin/e-smith/genfilelist $RPM_BUILD_ROOT | grep -v "\.pyc" | grep -v "\.pyo" > %{name}-%{version}-filelist %pre -/usr/bin/pip3 install pymysql -/usr/bin/pip3 install numpy -/usr/bin/pip3 install plotly -/usr/bin/pip3 install pandas +/usr/bin/pip3 install -q pymysql +/usr/bin/pip3 install -q numpy +/usr/bin/pip3 install -q plotly +/usr/bin/pip3 install -q pandas %clean /bin/rm -rf $RPM_BUILD_ROOT %files -f %{name}-%{version}-filelist -%defattr(-,root,root) \ No newline at end of file +%defattr(-,root,root)