summaryrefslogtreecommitdiff
path: root/swiftclient/shell.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-03-30 12:47:40 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-03-30 12:56:43 -0700
commit1d0c97fdb307f1e92f2b632cf3512d96b10f9b48 (patch)
tree4ba9a1b0dbe771750bbf726644bae89f4a544f7a /swiftclient/shell.py
parente3b7ecd2bbc5120444b3c1643fb89ccd47e454bb (diff)
downloadpython-swiftclient-1d0c97fdb307f1e92f2b632cf3512d96b10f9b48.tar.gz
Replaced print statements with print function.
This is needed for Python3 compatibility. Change-Id: Iadd21e4b3a936b601a69f1db2aba8e1597f13fc3
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-xswiftclient/shell.py32
1 files changed, 21 insertions, 11 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py
index 44ce3a0..236610d 100755
--- a/swiftclient/shell.py
+++ b/swiftclient/shell.py
@@ -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))