Replaced print statements with print function.

This is needed for Python3 compatibility.

Change-Id: Iadd21e4b3a936b601a69f1db2aba8e1597f13fc3
This commit is contained in:
Alex Gaynor 2014-03-30 12:47:40 -07:00
parent e3b7ecd2bb
commit 1d0c97fdb3
2 changed files with 25 additions and 12 deletions

@ -12,6 +12,9 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
from itertools import chain
import sys
from time import sleep
@ -258,7 +261,7 @@ class MultiThreadingManager(object):
stream = self.print_stream
if isinstance(item, unicode):
item = item.encode('utf8')
print >>stream, item
print(item, file=stream)
def _print_error(self, item):
self.error_count += 1

@ -13,6 +13,9 @@
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import signal
import socket
import logging
@ -233,9 +236,11 @@ def st_delete(parser, args, thread_manager):
thread_manager.error('Account not found')
elif len(args) == 1:
if '/' in args[0]:
print >> stderr, 'WARNING: / in container name; you ' \
'might have meant %r instead of %r.' % (
args[0].replace('/', ' ', 1), args[0])
print(
'WARNING: / in container name; you might have meant '
'%r instead of %r.' % (
args[0].replace('/', ' ', 1), args[0]),
file=stderr)
container_queue.put(args[0])
else:
for obj in args[1:]:
@ -497,10 +502,11 @@ def st_download(parser, args, thread_manager):
thread_manager.error('Account not found')
elif len(args) == 1:
if '/' in args[0]:
print >> stderr, (
print(
'WARNING: / in container name; you might have meant '
'%r instead of %r.' % (
args[0].replace('/', ' ', 1), args[0]))
args[0].replace('/', ' ', 1), args[0]),
file=stderr)
container_queue.put((args[0], object_queue, options.prefix))
else:
if len(args) == 2:
@ -664,9 +670,11 @@ def st_stat(parser, args, thread_manager):
thread_manager.error('Account not found')
elif len(args) == 1:
if '/' in args[0]:
print >> stderr, 'WARNING: / in container name; you might have ' \
'meant %r instead of %r.' % \
(args[0].replace('/', ' ', 1), args[0])
print(
'WARNING: / in container name; you might have meant %r instead'
' of %r.' % (
args[0].replace('/', ' ', 1), args[0]),
file=stderr)
try:
command_helpers.stat_container(conn, options, args,
thread_manager)
@ -758,9 +766,11 @@ def st_post(parser, args, thread_manager):
thread_manager.error('Account not found')
elif len(args) == 1:
if '/' in args[0]:
print >> stderr, 'WARNING: / in container name; you might have ' \
'meant %r instead of %r.' % \
(args[0].replace('/', ' ', 1), args[0])
print(
'WARNING: / in container name; you might have meant %r instead'
' of %r.' % (
args[0].replace('/', ' ', 1), args[0]),
file=stderr)
headers = split_headers(options.meta, 'X-Container-Meta-',
thread_manager)
headers.update(split_headers(options.header, '', thread_manager))