Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10897 - main/trunk/pym/portage
Date: Thu, 03 Jul 2008 03:09:28
Message-Id: E1KEFCE-0001vo-ID@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-07-03 03:09:21 +0000 (Thu, 03 Jul 2008)
3 New Revision: 10897
4
5 Modified:
6 main/trunk/pym/portage/output.py
7 Log:
8 Use stdout.write() instead of "print", for py3k compat.
9
10
11 Modified: main/trunk/pym/portage/output.py
12 ===================================================================
13 --- main/trunk/pym/portage/output.py 2008-07-02 22:44:03 UTC (rev 10896)
14 +++ main/trunk/pym/portage/output.py 2008-07-03 03:09:21 UTC (rev 10897)
15 @@ -461,8 +461,10 @@
16 self.ewarn(msg[0])
17 if self.__last_e_cmd != "ebegin":
18 self.__last_e_len = 0
19 - print "%*s%s" % ((self.term_columns - self.__last_e_len - 6), "", status_brackets)
20 - sys.stdout.flush()
21 + out = sys.stdout
22 + out.write("%*s%s\n" % \
23 + ((self.term_columns - self.__last_e_len - 6), "", status_brackets))
24 + out.flush()
25
26 def ebegin(self, msg):
27 """
28 @@ -501,10 +503,12 @@
29 @param msg: A very brief (shorter than one line) error message.
30 @type msg: StringType
31 """
32 + out = sys.stdout
33 if not self.quiet:
34 - if self.__last_e_cmd == "ebegin": print
35 - print colorize("BAD", " * ") + msg
36 - sys.stdout.flush()
37 + if self.__last_e_cmd == "ebegin":
38 + out.write("\n")
39 + out.write(colorize("BAD", " * ") + msg + "\n")
40 + out.flush()
41 self.__last_e_cmd = "eerror"
42
43 def einfo(self, msg):
44 @@ -514,10 +518,12 @@
45 @param msg: A very brief (shorter than one line) informative message.
46 @type msg: StringType
47 """
48 + out = sys.stdout
49 if not self.quiet:
50 - if self.__last_e_cmd == "ebegin": print
51 - print colorize("GOOD", " * ") + msg
52 - sys.stdout.flush()
53 + if self.__last_e_cmd == "ebegin":
54 + out.write("\n")
55 + out.write(colorize("GOOD", " * ") + msg + "\n")
56 + out.flush()
57 self.__last_e_cmd = "einfo"
58
59 def einfon(self, msg):
60 @@ -527,10 +533,12 @@
61 @param msg: A very brief (shorter than one line) informative message.
62 @type msg: StringType
63 """
64 + out = sys.stdout
65 if not self.quiet:
66 - if self.__last_e_cmd == "ebegin": print
67 - print colorize("GOOD", " * ") + msg ,
68 - sys.stdout.flush()
69 + if self.__last_e_cmd == "ebegin":
70 + out.write("\n")
71 + out.write(colorize("GOOD", " * ") + msg)
72 + out.flush()
73 self.__last_e_cmd = "einfon"
74
75 def ewarn(self, msg):
76 @@ -540,10 +548,12 @@
77 @param msg: A very brief (shorter than one line) warning message.
78 @type msg: StringType
79 """
80 + out = sys.stdout
81 if not self.quiet:
82 - if self.__last_e_cmd == "ebegin": print
83 - print colorize("WARN", " * ") + msg
84 - sys.stdout.flush()
85 + if self.__last_e_cmd == "ebegin":
86 + out.write("\n")
87 + out.write(colorize("WARN", " * ") + msg + "\n")
88 + out.flush()
89 self.__last_e_cmd = "ewarn"
90
91 def ewend(self, errno, *msg):
92
93 --
94 gentoo-commits@l.g.o mailing list