Merged back production changes to two scripts indirectly called by /a/www/www6s/scripts/run-ietf-report, through /a/www/www6s/scripts/run-report.

- Legacy-Id: 17371
This commit is contained in:
Henrik Levkowetz 2020-03-02 12:27:07 +00:00
parent a2318d9f2c
commit a33f66bb90
2 changed files with 9 additions and 12 deletions

View file

@ -3,21 +3,20 @@
# -*- Python -*-
#
# This script requires that the proper virtual python environment has been
# invoked before start
# Set PYTHONPATH and load environment variables for standalone script -----------------
import os, sys
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path = [ basedir ] + sys.path
os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
virtualenv_activation = os.path.join(basedir, "env", "bin", "activate_this.py")
if os.path.exists(virtualenv_activation):
execfile(virtualenv_activation, dict(__file__=virtualenv_activation))
import django
django.setup()
# -------------------------------------------------------------------------------------
from ietf.secr.drafts.reports import report_id_activity
print report_id_activity(sys.argv[1], sys.argv[2]),
print(report_id_activity(sys.argv[1], sys.argv[2]), end='')

View file

@ -3,16 +3,15 @@
# -*- Python -*-
#
# This script requires that the proper virtual python environment has been
# invoked before start
# Set PYTHONPATH and load environment variables for standalone script -----------------
import os, sys
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path = [ basedir ] + sys.path
os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
virtualenv_activation = os.path.join(basedir, "env", "bin", "activate_this.py")
if os.path.exists(virtualenv_activation):
execfile(virtualenv_activation, dict(__file__=virtualenv_activation))
import django
django.setup()
# -------------------------------------------------------------------------------------
@ -21,6 +20,5 @@ from ietf.secr.drafts.reports import report_progress_report
# handle unicode characters before attempting to print
output = report_progress_report(sys.argv[1], sys.argv[2])
output = output.replace(unichr(160),' ') # replace NO-BREAK SPACE with space
output = output.encode('ascii','replace')
print output,
output = output.replace(chr(160),' ') # replace NO-BREAK SPACE with space
print(output, end='')