mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-12 16:49:42 +00:00
Fix nodersync with output redirection
Variables were left unitialized, use them only in the tty path.
This commit is contained in:
parent
d5e4d1b90a
commit
55fc3bda51
@ -60,12 +60,12 @@ class ScreenPrinter(object):
|
||||
fieldformat = '{{0:>{0}}}:{{1:{1}}}'.format(self.nodenamelen,
|
||||
self.textlen)
|
||||
sys.stdout.write('\x1b[2J\x1b[;H') # clear screen
|
||||
if len(self.nodelist) < (numfields * currheight):
|
||||
numfields = len(self.nodelist) // currheight + 1
|
||||
else:
|
||||
numfields = 1
|
||||
fieldformat = '{0}: {1}'
|
||||
currfields = 0
|
||||
if len(self.nodelist) < (numfields * currheight):
|
||||
numfields = len(self.nodelist) // currheight + 1
|
||||
for node in self.nodelist:
|
||||
if currfields >= numfields:
|
||||
sys.stdout.write('\n')
|
||||
|
Loading…
x
Reference in New Issue
Block a user