From dae64e2f9de395150d22ff9525c031faedf70fe4 Mon Sep 17 00:00:00 2001 From: "mike.auty@gmail.com" Date: Mon, 4 Jun 2012 21:26:57 +0000 Subject: [PATCH] Make it easier to modify the table formatting for machine-readable delimiting as requested by scudette. --- volatility/commands.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/volatility/commands.py b/volatility/commands.py index 3554c315..26ce8ac1 100644 --- a/volatility/commands.py +++ b/volatility/commands.py @@ -29,6 +29,9 @@ class Command(object): cmdname = "" # meta_info will be removed meta_info = {} + # Make these class variables so they can be modified across every plugin + elide_data = True + tablesep = " " def __init__(self, config, *_args, **_kwargs): """ Constructor uses args as an initializer. It creates an instance @@ -37,7 +40,6 @@ class Command(object): """ self._config = config self._formatlist = [] - self.tablesep = " " @staticmethod def register_options(config): @@ -135,6 +137,10 @@ class Command(object): def _elide(self, string, length): """Adds three dots in the middle of a string if it is longer than length""" + # Only elide data if we've been asked to (which we are by default) + if not self.elide_data: + return string + if length == -1: return string if len(string) < length: