From 142e6f097ae574ff69b3432af8e06ff0bb1c33a1 Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Sat, 24 Aug 2024 18:11:17 -0400 Subject: [PATCH] switch to repr --- pyenliven/mttexture.py | 4 +--- utilities/run-any | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pyenliven/mttexture.py b/pyenliven/mttexture.py index 1122d6d..3f58776 100644 --- a/pyenliven/mttexture.py +++ b/pyenliven/mttexture.py @@ -33,7 +33,6 @@ import os from collections import OrderedDict from PIL import Image -from pprint import pformat def echo0(*args, **kwargs): @@ -179,7 +178,7 @@ def recompose_anim(options): raise ValueError( "{} should be a(n) {} but got {} {}." "".format(name, option_type_name, - type(value).__name__, pformat(value)) + type(value).__name__, repr(value)) ) framer = Framer() img = Image.open(options['path']) @@ -273,4 +272,3 @@ def main(): print('- & keep Lua same) with:') print('-- name="{}"'.format(new_path)) return 0 - diff --git a/utilities/run-any b/utilities/run-any index 0523065..e89dcfc 100755 --- a/utilities/run-any +++ b/utilities/run-any @@ -14,7 +14,6 @@ import subprocess import copy import shlex import platform -from pprint import pformat from collections import OrderedDict SCRIPTS_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -100,7 +99,7 @@ def show_and_return(cmd, enable_collect=False, cwd=None, shell=False): # ) if shell not in [None, True, False]: raise ValueError("Expected None, True, or False for shell but got %s" - % pformat(shell)) + % repr(shell)) if cwd is None: cwd = os.getcwd() if shell and not hasattr(cmd, "split"): @@ -140,7 +139,7 @@ def show_and_return(cmd, enable_collect=False, cwd=None, shell=False): cmd = ["bash", "-c", "cd '" + cwd + "'; " + pre_bin + shlex.join(cmd)] else: cmd = ["bash", "-c", "cd '" + cwd + "'; " + pre_bin + cmd] - run_msg = prefix+"Running %s" % pformat(cmd) + run_msg = prefix+"Running %s" % repr(cmd) run_msg += ' # shell=%s in "%s"' % (shell, cwd) echo0(run_msg) if cwd is not None: @@ -298,7 +297,7 @@ def show_and_return(cmd, enable_collect=False, cwd=None, shell=False): if len(meta['string']) > 0: raise NotImplementedError( "The remaining %s wasn't processed: %s" - % (_, pformat(meta['string'])) + % (_, repr(meta['string'])) ) return { 'code': code, @@ -387,7 +386,7 @@ def main(): if count < 1: cmd_msg = cmd if isinstance(cmd, str) else shlex.join(cmd) print(" (Output of `%s` had %s line(s) of output.)" - % (pformat(cmd_msg), count), + % (repr(cmd_msg), count), file=sys.stderr) else: print("", file=sys.stderr)