summaryrefslogtreecommitdiffstats
path: root/layman/output.py
diff options
context:
space:
mode:
authorBrian Dolbec <brian.dolbec@gmail.com>2011-03-26 20:24:26 -0700
committerBrian Dolbec <brian.dolbec@gmail.com>2011-03-26 20:24:26 -0700
commite14906b88ec2da99dba82d565d88ed5ca1d40099 (patch)
tree704b905dc66b6c21bfcfca6d95467bcf8bb650ea /layman/output.py
parentd73b5dacce0927e727db5aebb9384a6fd2bb1cd5 (diff)
downloadlayman-e14906b88ec2da99dba82d565d88ed5ca1d40099.tar.gz
layman-e14906b88ec2da99dba82d565d88ed5ca1d40099.tar.bz2
layman-e14906b88ec2da99dba82d565d88ed5ca1d40099.zip
migrate to print()
Diffstat (limited to 'layman/output.py')
-rw-r--r--layman/output.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/layman/output.py b/layman/output.py
index 469f673..caccd93 100644
--- a/layman/output.py
+++ b/layman/output.py
@@ -6,6 +6,7 @@
Distributed under the terms of the GNU General Public License v2
"""
+from __future__ import print_function
__version__ = "0.1"
@@ -112,7 +113,7 @@ class Message(MessageBase):
def notice (self, note):
- print >> self.std_out, note
+ print(note, file=self.std_out)
def info (self, info, level = INFO_LEVEL):
@@ -124,7 +125,7 @@ class Message(MessageBase):
return
for i in info.split('\n'):
- print >> self.std_out, self.color_func('green', '* ') + i
+ print(self.color_func('green', '* ') + i, file=self.std_out)
def status (self, message, status, info = 'ignored'):
@@ -138,7 +139,7 @@ class Message(MessageBase):
return
for i in lines[0:-1]:
- print >> self.std_out, self.color_func('green', '* ') + i
+ print(self.color_func('green', '* ') + i, file=self.std_out)
i = lines[-1]
@@ -152,8 +153,8 @@ class Message(MessageBase):
else:
result = '[' + self.color_func('yellow', info) + ']'
- print >> self.std_out, self.color_func('green', '* ') + i + ' ' + \
- '.' * (58 - len(i)) + ' ' + result
+ print(self.color_func('green', '* ') + i + ' ' + \
+ '.' * (58 - len(i)) + ' ' + result, file=self.std_out)
def warn (self, warn, level = WARN_LEVEL):
@@ -165,7 +166,7 @@ class Message(MessageBase):
return
for i in warn.split('\n'):
- print >> self.std_out, self.color_func('yellow', '* ') + i
+ print(self.color_func('yellow', '* ') + i, file=self.std_out)
def error (self, error):
@@ -178,7 +179,7 @@ class Message(MessageBase):
# stay in nice order. This is a workaround for calls like
# "layman -L |& less".
sys.stdout.flush()
- print >> self.error_out, self.color_func('red', '* ') + i
+ print(self.color_func('red', '* ') + i, file=self.error_out)
self.error_out.flush()
self.do_error_callback(error)