diff --git a/ietf/bin/report_id_activity b/ietf/bin/report_id_activity index 6f223b27e..87b7f7fe5 100755 --- a/ietf/bin/report_id_activity +++ b/ietf/bin/report_id_activity @@ -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='') diff --git a/ietf/bin/report_progress_report b/ietf/bin/report_progress_report index 9f537907f..b693aca77 100755 --- a/ietf/bin/report_progress_report +++ b/ietf/bin/report_progress_report @@ -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='')