mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-10 00:17:54 +02:00
UPDATED: print statements to be Python 3.x compatible
This commit is contained in:
@ -8,6 +8,7 @@ scripts/create_escalation_exclusion.py - Easy way to routinely add particular
|
||||
days to the list of days on which no
|
||||
escalation should take place.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
from datetime import timedelta, date
|
||||
import getopt
|
||||
@ -96,23 +97,24 @@ def create_exclusions(days, occurrences, verbose, queues):
|
||||
esc.save()
|
||||
|
||||
if verbose:
|
||||
print "Created exclusion for %s %s" % (day_name, workdate)
|
||||
print("Created exclusion for %s %s" % (day_name, workdate))
|
||||
|
||||
for q in queues:
|
||||
esc.queues.add(q)
|
||||
if verbose:
|
||||
print " - for queue %s" % q
|
||||
print(" - for queue %s" % q)
|
||||
|
||||
i += 1
|
||||
workdate += timedelta(days=1)
|
||||
|
||||
|
||||
def usage():
|
||||
print "Options:"
|
||||
print " --days, -d: Days of week (monday, tuesday, etc)"
|
||||
print " --occurrences, -o: Occurrences: How many weeks ahead to exclude this day"
|
||||
print " --queues, -q: Queues to include (default: all). Use queue slugs"
|
||||
print " --verbose, -v: Display a list of dates excluded"
|
||||
print("Options:")
|
||||
print(" --days, -d: Days of week (monday, tuesday, etc)")
|
||||
print(" --occurrences, -o: Occurrences: How many weeks ahead to exclude this day")
|
||||
print(" --queues, -q: Queues to include (default: all). Use queue slugs")
|
||||
print(" --verbose, -v: Display a list of dates excluded")
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@ -150,7 +152,7 @@ if __name__ == '__main__':
|
||||
try:
|
||||
q = Queue.objects.get(slug__exact=queue)
|
||||
except Queue.DoesNotExist:
|
||||
print "Queue %s does not exist." % queue
|
||||
print("Queue %s does not exist." % queue)
|
||||
sys.exit(2)
|
||||
queues.append(q)
|
||||
|
||||
|
Reference in New Issue
Block a user