From 044e1539e9f51613dd289713a1aa37ce05cbb0da Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Mon, 20 Jun 2016 17:19:04 +0800 Subject: [PATCH] fix clear command --- mujson_mgr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mujson_mgr.py b/mujson_mgr.py index 94f5781..c6403b9 100644 --- a/mujson_mgr.py +++ b/mujson_mgr.py @@ -110,12 +110,16 @@ class MuMgr(object): if 'port' in user and row['port'] != user['port']: match = False if match: - print("clear user %s" % self.userinfo(row['user'])) row.update(up) + print("clear user [%s]" % row['user']) self.data.save(self.config_path) def list_user(self, user): self.data.load(self.config_path) + if not user: + for row in self.data.json: + print("user [%s] port %s" % (row['user'], row['port'])) + return for row in self.data.json: match = True if 'user' in user and row['user'] != user['user']: