mirror of
https://github.com/iluvcapra/mfbatch.git
synced 2025-12-31 08:50:51 +00:00
pylint
This commit is contained in:
@@ -188,6 +188,18 @@ they appear in the batchfile.
|
|||||||
self.env.revert_onces()
|
self.env.revert_onces()
|
||||||
self.env.clear_file_keys()
|
self.env.clear_file_keys()
|
||||||
|
|
||||||
|
def _print_kv_columnar(self, key, value):
|
||||||
|
line_len = int(shutil.get_terminal_size()[0]) - 32
|
||||||
|
value_lines = [value[i:i+line_len] for i in
|
||||||
|
range(0, len(value), line_len)]
|
||||||
|
|
||||||
|
for l in value_lines:
|
||||||
|
if key:
|
||||||
|
sys.stdout.write(f"{key:.<30} \033[4m{l}\033[0m\n")
|
||||||
|
key = None
|
||||||
|
else:
|
||||||
|
sys.stdout.write(f"{' ' * 30} \033[4m{l}\033[0m\n")
|
||||||
|
|
||||||
def _handle_file(self, line, interactive):
|
def _handle_file(self, line, interactive):
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
@@ -204,16 +216,7 @@ they appear in the batchfile.
|
|||||||
if key.startswith('_'):
|
if key.startswith('_'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
line_len = int(shutil.get_terminal_size()[0]) - 32
|
self._print_kv_columnar(key, value)
|
||||||
value_lines = [value[i:i+line_len] for i in
|
|
||||||
range(0, len(value), line_len)]
|
|
||||||
|
|
||||||
for l in value_lines:
|
|
||||||
if key:
|
|
||||||
sys.stdout.write(f"{key:.<30} \033[4m{l}\033[0m\n")
|
|
||||||
key = None
|
|
||||||
else:
|
|
||||||
sys.stdout.write(f"{' ' * 30} \033[4m{l}\033[0m\n")
|
|
||||||
|
|
||||||
if interactive:
|
if interactive:
|
||||||
val = input('Write? [Y/n/a/:] > ')
|
val = input('Write? [Y/n/a/:] > ')
|
||||||
|
|||||||
Reference in New Issue
Block a user