Fix issues with python 2

This commit is contained in:
CorpNewt 2024-07-14 14:38:14 -05:00 committed by GitHub
parent 32aef451de
commit 738e324f56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -222,9 +222,10 @@ class Utils:
# Header drawing method
def head(self, text = None, width = 55):
if not self.interactive:
print(text, file=sys.stderr)
sys.stderr.write(str(text)+"\n")
sys.stderr.flush()
return
if text == None:
if text is None:
text = self.name
self.cls()
print(" {}".format("#"*width))
@ -245,7 +246,8 @@ class Utils:
if self.interactive:
print(text)
else:
print(text, file=sys.stderr)
sys.stderr.write(str(text)+"\n")
sys.stderr.flush()
def resize(self, width, height):
print('\033[8;{};{}t'.format(height, width))