UPDATED: print statements to be Python 3.x compatible

This commit is contained in:
Bruno Tikami
2016-03-01 17:01:58 -03:00
parent abf03d48d6
commit 2efe8255c5
4 changed files with 33 additions and 23 deletions

View File

@ -9,6 +9,7 @@ scripts/get_email.py - Designed to be run from cron, this script checks the
helpdesk, creating tickets from the new messages (or
adding to existing tickets if needed)
"""
from __future__ import print_function
import email
import imaplib
@ -83,7 +84,7 @@ def process_email(quiet=False):
def process_queue(q, quiet=False):
if not quiet:
print "Processing: %s" % q
print("Processing: %s" % q)
if q.socks_proxy_type and q.socks_proxy_host and q.socks_proxy_port:
try:
@ -290,7 +291,7 @@ def ticket_from_message(message, queue, quiet):
f.save()
if not quiet:
print (" [%s-%s] %s" % (t.queue.slug, t.id, t.title,)).encode('ascii', 'replace')
print((" [%s-%s] %s" % (t.queue.slug, t.id, t.title,)).encode('ascii', 'replace'))
for file in files:
if file['content']:
@ -305,7 +306,7 @@ def ticket_from_message(message, queue, quiet):
a.file.save(filename, ContentFile(file['content']), save=False)
a.save()
if not quiet:
print " - %s" % filename
print(" - %s" % filename)
context = safe_template_context(t)