More Py2/3 adaptations fetched from production.
- Legacy-Id: 17333
This commit is contained in:
parent
ab40807c36
commit
d9b11f31d9
|
@ -59,3 +59,4 @@ $DTDIR/ietf/manage.py fetch_meeting_attendance --latest 2
|
|||
|
||||
# Send reminders originating from the review app
|
||||
$DTDIR/ietf/bin/send-review-reminders
|
||||
|
||||
|
|
|
@ -6,10 +6,20 @@
|
|||
# $DTDIR/etc/cron.d/datatracker which should be symlinked from
|
||||
# /etc/cron.d/
|
||||
|
||||
export LANG=en_US.UTF-8
|
||||
export PYTHONIOENCODING=utf-8
|
||||
|
||||
# Make sure we stop if something goes wrong:
|
||||
program=${0##*/}
|
||||
trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)"; exit 1' ERR
|
||||
|
||||
DTDIR=/a/www/ietf-datatracker/web
|
||||
cd $DTDIR/
|
||||
|
||||
# Set up the virtual environment
|
||||
source $DTDIR/env/bin/activate
|
||||
|
||||
$DTDIR/ietf/manage.py import_mailman_listinfo
|
||||
logger -p user.info -t cron "Running $DTDIR/bin/mm_hourly"
|
||||
|
||||
## XXX commented out pending rewrite -- mailman 2 python interface is not available under Python 3
|
||||
# $DTDIR/ietf/manage.py import_mailman_listinfo
|
||||
|
|
|
@ -1,26 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright The IETF Trust 2016-2019, All Rights Reserved
|
||||
#!/a/www/ietf-datatracker/web/env/bin/python
|
||||
# Copyright The IETF Trust 2016-2020, All Rights Reserved
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
|
||||
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# change directory so patches etc. will be picked up as expected
|
||||
os.chdir(path)
|
||||
|
||||
# Virtualenv support
|
||||
virtualenv_activation = os.path.join(path, "env", "bin", "activate_this.py")
|
||||
if os.path.exists(virtualenv_activation):
|
||||
exec(compile(io.open(virtualenv_activation, "rb").read(), virtualenv_activation, 'exec'), dict(__file__=virtualenv_activation))
|
||||
else:
|
||||
raise RuntimeError("Could not find the expected virtual python environment.")
|
||||
|
||||
if not path in sys.path:
|
||||
sys.path.insert(0, path)
|
||||
|
||||
|
|
Loading…
Reference in a new issue