Core: Convert to format strings across the whole base

This commit is contained in:
Mike Auty
2021-07-18 15:53:58 +01:00
parent 99e959a15a
commit 9f52a15734
92 changed files with 386 additions and 386 deletions
+1 -1
View File
@@ -107,5 +107,5 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
for row in self._generator(
list_tasks(self.context, self.config['primary'], self.config['darwin'], filter_func = filter_func)):
_depth, row_data = row
description = "{} ({}): \"{}\"".format(row_data[0], row_data[1], row_data[3])
description = f"{row_data[0]} ({row_data[1]}): \"{row_data[3]}\""
yield (description, timeliner.TimeLinerType.CREATED, row_data[2])
@@ -45,7 +45,7 @@ class Ifconfig(plugins.PluginInterface):
for ifaddr in mac.MacUtilities.walk_tailq(ifnet.if_addrhead, "ifa_link"):
ip = ifaddr.ifa_addr.get_address()
yield (0, ("{0}{1}".format(name, unit), ip, mac_addr, prom))
yield (0, (f"{name}{unit}", ip, mac_addr, prom))
def run(self):
return renderers.TreeGrid([("Interface", str), ("IP Address", str), ("Mac Address", str),
+2 -2
View File
@@ -95,7 +95,7 @@ class Netstat(plugins.PluginInterface):
continue
yield (0, (format_hints.Hex(socket.vol.offset), "UNIX", path, 0, "", 0, "",
"{}/{:d}".format(task_name, pid)))
f"{task_name}/{pid:d}"))
elif family in [2, 30]:
state = socket.get_state()
@@ -107,7 +107,7 @@ class Netstat(plugins.PluginInterface):
(lip, lport, rip, rport) = vals
yield (0, (format_hints.Hex(socket.vol.offset), proto, lip, lport, rip, rport, state,
"{}/{:d}".format(task_name, pid)))
f"{task_name}/{pid:d}"))
def run(self):
return renderers.TreeGrid([("Offset", format_hints.Hex), ("Proto", str), ("Local IP", str), ("Local Port", int),
+1 -1
View File
@@ -68,7 +68,7 @@ class PsList(interfaces.plugins.PluginInterface):
list_tasks = cls.list_tasks_pid_hash_table
else:
raise ValueError("Impossible method choice chosen")
vollog.debug("Using method {}".format(method))
vollog.debug(f"Using method {method}")
return list_tasks