p3ize
This commit is contained in:
@@ -133,13 +133,13 @@ class bc:
|
|||||||
return "\033[" + str(y) + ";" + str(x) + "H"
|
return "\033[" + str(y) + ";" + str(x) + "H"
|
||||||
|
|
||||||
def posprint(self, y, x, s):
|
def posprint(self, y, x, s):
|
||||||
sys.stdout.write((self.pos(y, x) + str(s)).encode("utf-8"))
|
sys.stdout.write((self.pos(y, x) + str(s)))
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
sys.stdout.write((self.CLR + self.pos(0, 0)).encode("utf-8"))
|
sys.stdout.write((self.CLR + self.pos(0, 0)))
|
||||||
|
|
||||||
def clear_to_end(self):
|
def clear_to_end(self):
|
||||||
sys.stdout.write(self.CLREND.encode("utf-8"))
|
sys.stdout.write(self.CLREND)
|
||||||
|
|
||||||
def color_char(self, s):
|
def color_char(self, s):
|
||||||
for i, c in enumerate(self.color_keys):
|
for i, c in enumerate(self.color_keys):
|
||||||
@@ -154,7 +154,7 @@ class bc:
|
|||||||
|
|
||||||
def end_drawing(opts):
|
def end_drawing(opts):
|
||||||
if opts.zero_final:
|
if opts.zero_final:
|
||||||
sys.stdout.write(bc.Z.encode("utf-8"))
|
sys.stdout.write(bc.Z)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
@@ -299,9 +299,7 @@ u f u
|
|||||||
; f U
|
; f U
|
||||||
; f U
|
; f U
|
||||||
====EOI
|
====EOI
|
||||||
Outputs:'''.encode(
|
Outputs:'''
|
||||||
"utf-8"
|
|
||||||
)
|
|
||||||
return testimage.split("\n")
|
return testimage.split("\n")
|
||||||
|
|
||||||
|
|
||||||
@@ -325,7 +323,7 @@ while True:
|
|||||||
for row in f:
|
for row in f:
|
||||||
if not row:
|
if not row:
|
||||||
end_drawing(opts)
|
end_drawing(opts)
|
||||||
row = row.decode("utf-8").rstrip("\n\r")
|
row = row.rstrip("\n\r")
|
||||||
if row.startswith(NEWIMAGE):
|
if row.startswith(NEWIMAGE):
|
||||||
break
|
break
|
||||||
if row.startswith(ENDOFFILE):
|
if row.startswith(ENDOFFILE):
|
||||||
@@ -379,7 +377,7 @@ while True:
|
|||||||
for frame in colors:
|
for frame in colors:
|
||||||
try:
|
try:
|
||||||
if frame[i][c] != " ":
|
if frame[i][c] != " ":
|
||||||
sys.stdout.write(bc.color_char(frame[i][c]).encode("utf-8"))
|
sys.stdout.write(bc.color_char(frame[i][c]))
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
char = " "
|
char = " "
|
||||||
@@ -388,9 +386,9 @@ while True:
|
|||||||
continue
|
continue
|
||||||
char = layer[i][c]
|
char = layer[i][c]
|
||||||
|
|
||||||
sys.stdout.write(char.encode("utf-8"))
|
sys.stdout.write(char)
|
||||||
if opts.color and opts.zero:
|
if opts.color and opts.zero:
|
||||||
sys.stdout.write(bc.Z.encode("utf-8"))
|
sys.stdout.write(bc.Z)
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
if pause > 0:
|
if pause > 0:
|
||||||
time.sleep(pause)
|
time.sleep(pause)
|
||||||
|
|||||||
Reference in New Issue
Block a user