@@ -101,7 +101,8 @@ class FuzzyJSON(ast.NodeTransformer):
'''This extension of ast.NodeTransformer filters literal "true/false/null"
values in an AST and replaces them by proper "True/False/None" values that
Python can properly evaluate.'''
- def visit_Name(self, node):
+ @classmethod
+ def visit_Name(cls, node):
if node.id == 'true':
node.id = 'True'
if node.id == 'false':
@@ -124,7 +125,8 @@ class QMPShell(qmp.QEMUMonitorProtocol):
self._histfile = os.path.join(os.path.expanduser('~'),
'.qmp-shell_history')
- def __get_address(self, arg):
+ @classmethod
+ def __get_address(cls, arg):
"""
Figure out if the argument is in the port:host form, if it's not it's
probably a file path.
@@ -171,7 +173,8 @@ class QMPShell(qmp.QEMUMonitorProtocol):
except Exception as e:
print("Failed to save history file '%s'; %s" % (self._histfile, e))
- def __parse_value(self, val):
+ @classmethod
+ def __parse_value(cls, val):
try:
return int(val)
except ValueError:
Methods with no self-use should belong to the class. Signed-off-by: John Snow <jsnow@redhat.com> --- scripts/qmp/qmp-shell | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)