From 931fe97b9e71db259fa0a1fd2a79a35c68fbb126 Mon Sep 17 00:00:00 2001 From: Gideon Bature Date: Mon, 16 Oct 2023 00:15:54 +0100 Subject: [PATCH] fix pycodestyle --- console.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/console.py b/console.py index a9ec0a1..9d93ca6 100755 --- a/console.py +++ b/console.py @@ -225,6 +225,24 @@ def do_update(self, line): setattr(obj, attr_name, attr_value) storage.save() + def default(self, line): + """Retrieves all instances of a class + Usage: .all() + Args: + : The class name + all(): the method + Returns: + None + """ + args = line.split('.') + + cls_name = args[0] + cls_method = args[1] + + if cls_name in self.__classes: + if cls_method == "all()": + self.do_all(cls_name) + def postcmd(self, stop, line): """Program exit cleanly in response to the quit command """