mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-103668: Run pyugrade on idlelib (#103671)
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
parent
7255bbd4a1
commit
bd2dca035a
17 changed files with 50 additions and 50 deletions
|
@ -25,7 +25,7 @@ class CalltipWindow(TooltipBase):
|
||||||
text_widget: a Text widget with code for which call-tips are desired
|
text_widget: a Text widget with code for which call-tips are desired
|
||||||
"""
|
"""
|
||||||
# Note: The Text widget will be accessible as self.anchor_widget
|
# Note: The Text widget will be accessible as self.anchor_widget
|
||||||
super(CalltipWindow, self).__init__(text_widget)
|
super().__init__(text_widget)
|
||||||
|
|
||||||
self.label = self.text = None
|
self.label = self.text = None
|
||||||
self.parenline = self.parencol = self.lastline = None
|
self.parenline = self.parencol = self.lastline = None
|
||||||
|
@ -54,7 +54,7 @@ class CalltipWindow(TooltipBase):
|
||||||
return
|
return
|
||||||
self.lastline = curline
|
self.lastline = curline
|
||||||
self.anchor_widget.see("insert")
|
self.anchor_widget.see("insert")
|
||||||
super(CalltipWindow, self).position_window()
|
super().position_window()
|
||||||
|
|
||||||
def showtip(self, text, parenleft, parenright):
|
def showtip(self, text, parenleft, parenright):
|
||||||
"""Show the call-tip, bind events which will close it and reposition it.
|
"""Show the call-tip, bind events which will close it and reposition it.
|
||||||
|
@ -73,7 +73,7 @@ class CalltipWindow(TooltipBase):
|
||||||
self.parenline, self.parencol = map(
|
self.parenline, self.parencol = map(
|
||||||
int, self.anchor_widget.index(parenleft).split("."))
|
int, self.anchor_widget.index(parenleft).split("."))
|
||||||
|
|
||||||
super(CalltipWindow, self).showtip()
|
super().showtip()
|
||||||
|
|
||||||
self._bind_events()
|
self._bind_events()
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ class CalltipWindow(TooltipBase):
|
||||||
# ValueError may be raised by MultiCall
|
# ValueError may be raised by MultiCall
|
||||||
pass
|
pass
|
||||||
|
|
||||||
super(CalltipWindow, self).hidetip()
|
super().hidetip()
|
||||||
|
|
||||||
def _bind_events(self):
|
def _bind_events(self):
|
||||||
"""Bind event handlers."""
|
"""Bind event handlers."""
|
||||||
|
|
|
@ -49,9 +49,9 @@ class Idb(bdb.Bdb):
|
||||||
filename = code.co_filename
|
filename = code.co_filename
|
||||||
lineno = frame.f_lineno
|
lineno = frame.f_lineno
|
||||||
basename = os.path.basename(filename)
|
basename = os.path.basename(filename)
|
||||||
message = "%s:%s" % (basename, lineno)
|
message = f"{basename}:{lineno}"
|
||||||
if code.co_name != "?":
|
if code.co_name != "?":
|
||||||
message = "%s: %s()" % (message, code.co_name)
|
message = f"{message}: {code.co_name}()"
|
||||||
return message
|
return message
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,7 +213,8 @@ class Debugger:
|
||||||
m1 = "%s" % str(type)
|
m1 = "%s" % str(type)
|
||||||
if value is not None:
|
if value is not None:
|
||||||
try:
|
try:
|
||||||
m1 = "%s: %s" % (m1, str(value))
|
# TODO redo entire section, tries not needed.
|
||||||
|
m1 = f"{m1}: {value}"
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
bg = "yellow"
|
bg = "yellow"
|
||||||
|
|
|
@ -87,7 +87,7 @@ class SequenceTreeItem(ObjectTreeItem):
|
||||||
continue
|
continue
|
||||||
def setfunction(value, key=key, object=self.object):
|
def setfunction(value, key=key, object=self.object):
|
||||||
object[key] = value
|
object[key] = value
|
||||||
item = make_objecttreeitem("%r:" % (key,), value, setfunction)
|
item = make_objecttreeitem(f"{key!r}:", value, setfunction)
|
||||||
sublist.append(item)
|
sublist.append(item)
|
||||||
return sublist
|
return sublist
|
||||||
|
|
||||||
|
|
|
@ -38,12 +38,13 @@ darwin = sys.platform == 'darwin'
|
||||||
def _sphinx_version():
|
def _sphinx_version():
|
||||||
"Format sys.version_info to produce the Sphinx version string used to install the chm docs"
|
"Format sys.version_info to produce the Sphinx version string used to install the chm docs"
|
||||||
major, minor, micro, level, serial = sys.version_info
|
major, minor, micro, level, serial = sys.version_info
|
||||||
release = '%s%s' % (major, minor)
|
# TODO remove unneeded function since .chm no longer installed
|
||||||
release += '%s' % (micro,)
|
release = f'{major}{minor}'
|
||||||
|
release += f'{micro}'
|
||||||
if level == 'candidate':
|
if level == 'candidate':
|
||||||
release += 'rc%s' % (serial,)
|
release += f'rc{serial}'
|
||||||
elif level != 'final':
|
elif level != 'final':
|
||||||
release += '%s%s' % (level[0], serial)
|
release += f'{level[0]}{serial}'
|
||||||
return release
|
return release
|
||||||
|
|
||||||
|
|
||||||
|
@ -950,7 +951,7 @@ class EditorWindow:
|
||||||
rf_list = []
|
rf_list = []
|
||||||
file_path = self.recent_files_path
|
file_path = self.recent_files_path
|
||||||
if file_path and os.path.exists(file_path):
|
if file_path and os.path.exists(file_path):
|
||||||
with open(file_path, 'r',
|
with open(file_path,
|
||||||
encoding='utf_8', errors='replace') as rf_list_file:
|
encoding='utf_8', errors='replace') as rf_list_file:
|
||||||
rf_list = rf_list_file.readlines()
|
rf_list = rf_list_file.readlines()
|
||||||
if new_file:
|
if new_file:
|
||||||
|
@ -1458,7 +1459,7 @@ class EditorWindow:
|
||||||
else:
|
else:
|
||||||
self.reindent_to(y.compute_backslash_indent())
|
self.reindent_to(y.compute_backslash_indent())
|
||||||
else:
|
else:
|
||||||
assert 0, "bogus continuation type %r" % (c,)
|
assert 0, f"bogus continuation type {c!r}"
|
||||||
return "break"
|
return "break"
|
||||||
|
|
||||||
# This line starts a brand new statement; indent relative to
|
# This line starts a brand new statement; indent relative to
|
||||||
|
|
|
@ -22,7 +22,7 @@ class FileList:
|
||||||
# This can happen when bad filename is passed on command line:
|
# This can happen when bad filename is passed on command line:
|
||||||
messagebox.showerror(
|
messagebox.showerror(
|
||||||
"File Error",
|
"File Error",
|
||||||
"%r is a directory." % (filename,),
|
f"{filename!r} is a directory.",
|
||||||
master=self.root)
|
master=self.root)
|
||||||
return None
|
return None
|
||||||
key = os.path.normcase(filename)
|
key = os.path.normcase(filename)
|
||||||
|
@ -90,7 +90,7 @@ class FileList:
|
||||||
self.inversedict[conflict] = None
|
self.inversedict[conflict] = None
|
||||||
messagebox.showerror(
|
messagebox.showerror(
|
||||||
"Name Conflict",
|
"Name Conflict",
|
||||||
"You now have multiple edit windows open for %r" % (filename,),
|
f"You now have multiple edit windows open for {filename!r}",
|
||||||
master=self.root)
|
master=self.root)
|
||||||
self.dict[newkey] = edit
|
self.dict[newkey] = edit
|
||||||
self.inversedict[edit] = newkey
|
self.inversedict[edit] = newkey
|
||||||
|
|
|
@ -191,7 +191,7 @@ class IdleConfTest(unittest.TestCase):
|
||||||
idle_dir = os.path.abspath(sys.path[0])
|
idle_dir = os.path.abspath(sys.path[0])
|
||||||
for ctype in conf.config_types:
|
for ctype in conf.config_types:
|
||||||
config_path = os.path.join(idle_dir, '../config-%s.def' % ctype)
|
config_path = os.path.join(idle_dir, '../config-%s.def' % ctype)
|
||||||
with open(config_path, 'r') as f:
|
with open(config_path) as f:
|
||||||
cls.config_string[ctype] = f.read()
|
cls.config_string[ctype] = f.read()
|
||||||
|
|
||||||
cls.orig_warn = config._warn
|
cls.orig_warn = config._warn
|
||||||
|
|
|
@ -159,7 +159,7 @@ class ModuleFunctionTest(unittest.TestCase):
|
||||||
for line, expected_output in test_lines:
|
for line, expected_output in test_lines:
|
||||||
self.assertEqual(flh(line), expected_output)
|
self.assertEqual(flh(line), expected_output)
|
||||||
if expected_output:
|
if expected_output:
|
||||||
mock_open.assert_called_with(expected_output[0], 'r')
|
mock_open.assert_called_with(expected_output[0])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -52,9 +52,9 @@ else:
|
||||||
_modifier_masks = (MC_CONTROL, MC_ALT, MC_SHIFT, MC_META)
|
_modifier_masks = (MC_CONTROL, MC_ALT, MC_SHIFT, MC_META)
|
||||||
|
|
||||||
# a dictionary to map a modifier name into its number
|
# a dictionary to map a modifier name into its number
|
||||||
_modifier_names = dict([(name, number)
|
_modifier_names = {name: number
|
||||||
for number in range(len(_modifiers))
|
for number in range(len(_modifiers))
|
||||||
for name in _modifiers[number]])
|
for name in _modifiers[number]}
|
||||||
|
|
||||||
# In 3.4, if no shell window is ever open, the underlying Tk widget is
|
# In 3.4, if no shell window is ever open, the underlying Tk widget is
|
||||||
# destroyed before .__del__ methods here are called. The following
|
# destroyed before .__del__ methods here are called. The following
|
||||||
|
@ -134,7 +134,7 @@ def expand_substates(states):
|
||||||
return nb
|
return nb
|
||||||
statelist = []
|
statelist = []
|
||||||
for state in states:
|
for state in states:
|
||||||
substates = list(set(state & x for x in states))
|
substates = list({state & x for x in states})
|
||||||
substates.sort(key=nbits, reverse=True)
|
substates.sort(key=nbits, reverse=True)
|
||||||
statelist.append(substates)
|
statelist.append(substates)
|
||||||
return statelist
|
return statelist
|
||||||
|
@ -258,9 +258,9 @@ _types = (
|
||||||
_binder_classes = (_ComplexBinder,) * 4 + (_SimpleBinder,) * (len(_types)-4)
|
_binder_classes = (_ComplexBinder,) * 4 + (_SimpleBinder,) * (len(_types)-4)
|
||||||
|
|
||||||
# A dictionary to map a type name into its number
|
# A dictionary to map a type name into its number
|
||||||
_type_names = dict([(name, number)
|
_type_names = {name: number
|
||||||
for number in range(len(_types))
|
for number in range(len(_types))
|
||||||
for name in _types[number]])
|
for name in _types[number]}
|
||||||
|
|
||||||
_keysym_re = re.compile(r"^\w+$")
|
_keysym_re = re.compile(r"^\w+$")
|
||||||
_button_re = re.compile(r"^[1-5]$")
|
_button_re = re.compile(r"^[1-5]$")
|
||||||
|
|
|
@ -42,7 +42,7 @@ def file_line_helper(line):
|
||||||
if match:
|
if match:
|
||||||
filename, lineno = match.group(1, 2)
|
filename, lineno = match.group(1, 2)
|
||||||
try:
|
try:
|
||||||
f = open(filename, "r")
|
f = open(filename)
|
||||||
f.close()
|
f.close()
|
||||||
break
|
break
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|
|
@ -249,7 +249,7 @@ class PyShellEditorWindow(EditorWindow):
|
||||||
breaks = self.breakpoints
|
breaks = self.breakpoints
|
||||||
filename = self.io.filename
|
filename = self.io.filename
|
||||||
try:
|
try:
|
||||||
with open(self.breakpointPath, "r") as fp:
|
with open(self.breakpointPath) as fp:
|
||||||
lines = fp.readlines()
|
lines = fp.readlines()
|
||||||
except OSError:
|
except OSError:
|
||||||
lines = []
|
lines = []
|
||||||
|
@ -279,7 +279,7 @@ class PyShellEditorWindow(EditorWindow):
|
||||||
if filename is None:
|
if filename is None:
|
||||||
return
|
return
|
||||||
if os.path.isfile(self.breakpointPath):
|
if os.path.isfile(self.breakpointPath):
|
||||||
with open(self.breakpointPath, "r") as fp:
|
with open(self.breakpointPath) as fp:
|
||||||
lines = fp.readlines()
|
lines = fp.readlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith(filename + '='):
|
if line.startswith(filename + '='):
|
||||||
|
@ -441,7 +441,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
# run from the IDLE source directory.
|
# run from the IDLE source directory.
|
||||||
del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc',
|
del_exitf = idleConf.GetOption('main', 'General', 'delete-exitfunc',
|
||||||
default=False, type='bool')
|
default=False, type='bool')
|
||||||
command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,)
|
command = f"__import__('idlelib.run').run.main({del_exitf!r})"
|
||||||
return [sys.executable] + w + ["-c", command, str(self.port)]
|
return [sys.executable] + w + ["-c", command, str(self.port)]
|
||||||
|
|
||||||
def start_subprocess(self):
|
def start_subprocess(self):
|
||||||
|
@ -574,9 +574,9 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
|
|
||||||
self.runcommand("""if 1:
|
self.runcommand("""if 1:
|
||||||
import sys as _sys
|
import sys as _sys
|
||||||
_sys.path = %r
|
_sys.path = {!r}
|
||||||
del _sys
|
del _sys
|
||||||
\n""" % (path,))
|
\n""".format(path))
|
||||||
|
|
||||||
active_seq = None
|
active_seq = None
|
||||||
|
|
||||||
|
@ -703,14 +703,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
def prepend_syspath(self, filename):
|
def prepend_syspath(self, filename):
|
||||||
"Prepend sys.path with file's directory if not already included"
|
"Prepend sys.path with file's directory if not already included"
|
||||||
self.runcommand("""if 1:
|
self.runcommand("""if 1:
|
||||||
_filename = %r
|
_filename = {!r}
|
||||||
import sys as _sys
|
import sys as _sys
|
||||||
from os.path import dirname as _dirname
|
from os.path import dirname as _dirname
|
||||||
_dir = _dirname(_filename)
|
_dir = _dirname(_filename)
|
||||||
if not _dir in _sys.path:
|
if not _dir in _sys.path:
|
||||||
_sys.path.insert(0, _dir)
|
_sys.path.insert(0, _dir)
|
||||||
del _filename, _sys, _dirname, _dir
|
del _filename, _sys, _dirname, _dir
|
||||||
\n""" % (filename,))
|
\n""".format(filename))
|
||||||
|
|
||||||
def showsyntaxerror(self, filename=None):
|
def showsyntaxerror(self, filename=None):
|
||||||
"""Override Interactive Interpreter method: Use Colorizing
|
"""Override Interactive Interpreter method: Use Colorizing
|
||||||
|
@ -1536,7 +1536,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(sys.argv[1:], "c:deihnr:st:")
|
opts, args = getopt.getopt(sys.argv[1:], "c:deihnr:st:")
|
||||||
except getopt.error as msg:
|
except getopt.error as msg:
|
||||||
print("Error: %s\n%s" % (msg, usage_msg), file=sys.stderr)
|
print(f"Error: {msg}\n{usage_msg}", file=sys.stderr)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o == '-c':
|
if o == '-c':
|
||||||
|
@ -1668,9 +1668,9 @@ def main():
|
||||||
if cmd or script:
|
if cmd or script:
|
||||||
shell.interp.runcommand("""if 1:
|
shell.interp.runcommand("""if 1:
|
||||||
import sys as _sys
|
import sys as _sys
|
||||||
_sys.argv = %r
|
_sys.argv = {!r}
|
||||||
del _sys
|
del _sys
|
||||||
\n""" % (sys.argv,))
|
\n""".format(sys.argv))
|
||||||
if cmd:
|
if cmd:
|
||||||
shell.interp.execsource(cmd)
|
shell.interp.execsource(cmd)
|
||||||
elif script:
|
elif script:
|
||||||
|
|
|
@ -47,9 +47,8 @@ class WidgetRedirector:
|
||||||
tk.createcommand(w, self.dispatch)
|
tk.createcommand(w, self.dispatch)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "%s(%s<%s>)" % (self.__class__.__name__,
|
w = self.widget
|
||||||
self.widget.__class__.__name__,
|
return f"{self.__class__.__name__,}({w.__class__.__name__}<{w._w}>)"
|
||||||
self.widget._w)
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"Unregister operations and revert redirection created by .__init__."
|
"Unregister operations and revert redirection created by .__init__."
|
||||||
|
@ -143,8 +142,7 @@ class OriginalCommand:
|
||||||
self.orig_and_operation = (redir.orig, operation)
|
self.orig_and_operation = (redir.orig, operation)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "%s(%r, %r)" % (self.__class__.__name__,
|
return f"{self.__class__.__name__,}({self.redir!r}, {self.operation!r})"
|
||||||
self.redir, self.operation)
|
|
||||||
|
|
||||||
def __call__(self, *args):
|
def __call__(self, *args):
|
||||||
return self.tk_call(self.orig_and_operation + args)
|
return self.tk_call(self.orig_and_operation + args)
|
||||||
|
|
|
@ -174,7 +174,7 @@ class SocketIO:
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return ("ERROR", "Bad request format")
|
return ("ERROR", "Bad request format")
|
||||||
if oid not in self.objtable:
|
if oid not in self.objtable:
|
||||||
return ("ERROR", "Unknown object id: %r" % (oid,))
|
return ("ERROR", f"Unknown object id: {oid!r}")
|
||||||
obj = self.objtable[oid]
|
obj = self.objtable[oid]
|
||||||
if methodname == "__methods__":
|
if methodname == "__methods__":
|
||||||
methods = {}
|
methods = {}
|
||||||
|
@ -185,7 +185,7 @@ class SocketIO:
|
||||||
_getattributes(obj, attributes)
|
_getattributes(obj, attributes)
|
||||||
return ("OK", attributes)
|
return ("OK", attributes)
|
||||||
if not hasattr(obj, methodname):
|
if not hasattr(obj, methodname):
|
||||||
return ("ERROR", "Unsupported method name: %r" % (methodname,))
|
return ("ERROR", f"Unsupported method name: {methodname!r}")
|
||||||
method = getattr(obj, methodname)
|
method = getattr(obj, methodname)
|
||||||
try:
|
try:
|
||||||
if how == 'CALL':
|
if how == 'CALL':
|
||||||
|
|
|
@ -52,13 +52,13 @@ def idle_formatwarning(message, category, filename, lineno, line=None):
|
||||||
"""Format warnings the IDLE way."""
|
"""Format warnings the IDLE way."""
|
||||||
|
|
||||||
s = "\nWarning (from warnings module):\n"
|
s = "\nWarning (from warnings module):\n"
|
||||||
s += ' File \"%s\", line %s\n' % (filename, lineno)
|
s += f' File \"{filename}\", line {lineno}\n'
|
||||||
if line is None:
|
if line is None:
|
||||||
line = linecache.getline(filename, lineno)
|
line = linecache.getline(filename, lineno)
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line:
|
if line:
|
||||||
s += " %s\n" % line
|
s += " %s\n" % line
|
||||||
s += "%s: %s\n" % (category.__name__, message)
|
s += f"{category.__name__}: {message}\n"
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def idle_showwarning_subproc(
|
def idle_showwarning_subproc(
|
||||||
|
|
|
@ -169,7 +169,7 @@ def view_file(parent, title, filename, encoding, modal=True, wrap='word',
|
||||||
with contents of the file.
|
with contents of the file.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
with open(filename, 'r', encoding=encoding) as file:
|
with open(filename, encoding=encoding) as file:
|
||||||
contents = file.read()
|
contents = file.read()
|
||||||
except OSError:
|
except OSError:
|
||||||
showerror(title='File Load Error',
|
showerror(title='File Load Error',
|
||||||
|
|
|
@ -92,7 +92,7 @@ class OnHoverTooltipBase(TooltipBase):
|
||||||
e.g. after hovering over the anchor widget with the mouse for enough
|
e.g. after hovering over the anchor widget with the mouse for enough
|
||||||
time.
|
time.
|
||||||
"""
|
"""
|
||||||
super(OnHoverTooltipBase, self).__init__(anchor_widget)
|
super().__init__(anchor_widget)
|
||||||
self.hover_delay = hover_delay
|
self.hover_delay = hover_delay
|
||||||
|
|
||||||
self._after_id = None
|
self._after_id = None
|
||||||
|
@ -107,7 +107,7 @@ class OnHoverTooltipBase(TooltipBase):
|
||||||
self.anchor_widget.unbind("<Button>", self._id3) # pragma: no cover
|
self.anchor_widget.unbind("<Button>", self._id3) # pragma: no cover
|
||||||
except TclError:
|
except TclError:
|
||||||
pass
|
pass
|
||||||
super(OnHoverTooltipBase, self).__del__()
|
super().__del__()
|
||||||
|
|
||||||
def _show_event(self, event=None):
|
def _show_event(self, event=None):
|
||||||
"""event handler to display the tooltip"""
|
"""event handler to display the tooltip"""
|
||||||
|
@ -139,7 +139,7 @@ class OnHoverTooltipBase(TooltipBase):
|
||||||
self.unschedule()
|
self.unschedule()
|
||||||
except TclError: # pragma: no cover
|
except TclError: # pragma: no cover
|
||||||
pass
|
pass
|
||||||
super(OnHoverTooltipBase, self).hidetip()
|
super().hidetip()
|
||||||
|
|
||||||
|
|
||||||
class Hovertip(OnHoverTooltipBase):
|
class Hovertip(OnHoverTooltipBase):
|
||||||
|
@ -154,7 +154,7 @@ class Hovertip(OnHoverTooltipBase):
|
||||||
e.g. after hovering over the anchor widget with the mouse for enough
|
e.g. after hovering over the anchor widget with the mouse for enough
|
||||||
time.
|
time.
|
||||||
"""
|
"""
|
||||||
super(Hovertip, self).__init__(anchor_widget, hover_delay=hover_delay)
|
super().__init__(anchor_widget, hover_delay=hover_delay)
|
||||||
self.text = text
|
self.text = text
|
||||||
|
|
||||||
def showcontents(self):
|
def showcontents(self):
|
||||||
|
|
|
@ -32,7 +32,7 @@ except NameError:
|
||||||
if os.path.isdir(_icondir):
|
if os.path.isdir(_icondir):
|
||||||
ICONDIR = _icondir
|
ICONDIR = _icondir
|
||||||
elif not os.path.isdir(ICONDIR):
|
elif not os.path.isdir(ICONDIR):
|
||||||
raise RuntimeError("can't find icon directory (%r)" % (ICONDIR,))
|
raise RuntimeError(f"can't find icon directory ({ICONDIR!r})")
|
||||||
|
|
||||||
def listicons(icondir=ICONDIR):
|
def listicons(icondir=ICONDIR):
|
||||||
"""Utility to display the available icons."""
|
"""Utility to display the available icons."""
|
||||||
|
|
|
@ -309,7 +309,7 @@ class CommandSequence(Command):
|
||||||
s = self.__class__.__name__
|
s = self.__class__.__name__
|
||||||
strs = []
|
strs = []
|
||||||
for cmd in self.cmds:
|
for cmd in self.cmds:
|
||||||
strs.append(" %r" % (cmd,))
|
strs.append(f" {cmd!r}")
|
||||||
return s + "(\n" + ",\n".join(strs) + "\n)"
|
return s + "(\n" + ",\n".join(strs) + "\n)"
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue