From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org
Cc: gerald.rogers@intel.com, sy.jong.choi@intel.com,
Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Subject: [spp] [PATCH 1/3] spp: fix bug of precmd
Date: Tue, 3 Oct 2017 19:42:12 +0900 [thread overview]
Message-ID: <20171003104214.81003-1-ogawa.yasufumi@lab.ntt.co.jp> (raw)
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
In precmd function, command log is not recorded if it is
'playback' to avoid illegal action when the log is loaded.
However, 'bye' should be also excluded from the log because
spp.py is terminated immediately if the log is loaded.
This change for adding a condition for command logging.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/spp.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/spp.py b/src/spp.py
index 68b3a3f..4aa0c62 100755
--- a/src/spp.py
+++ b/src/spp.py
@@ -503,8 +503,9 @@ class Shell(cmd.Cmd):
def precmd(self, line):
line = line.lower()
- if self.recorded_file and 'playback' not in line:
- print(line, file=self.recorded_file)
+ if self.recorded_file:
+ if not (('playback' in line) or ('bye' in line)):
+ print(line, file=self.recorded_file)
return line
def close(self):
--
2.13.1
next reply other threads:[~2017-10-03 10:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 10:42 ogawa.yasufumi [this message]
2017-10-03 10:42 ` [spp] [PATCH 2/3] spp: add record file check ogawa.yasufumi
2017-10-03 10:42 ` [spp] [PATCH 3/3] spp: change logger to optional ogawa.yasufumi
2017-11-29 1:35 ` [spp] [PATCH 1/3] spp: fix bug of precmd Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171003104214.81003-1-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=gerald.rogers@intel.com \
--cc=spp@dpdk.org \
--cc=sy.jong.choi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).