Skip to content

Commit daab642

Browse files
committed
cli: testing pager for some commands
1 parent 05d5c50 commit daab642

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mptcpanalyzer/cli.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -816,12 +816,12 @@ def do_list_reinjections(self, line):
816816
# TODO use ppaged
817817
reinjections = df.dropna(axis=0, subset=["reinjection_of"] )
818818
total_nb_reinjections = 0
819+
output = ""
819820
for row in reinjections.itertuples():
820821
# if row.packetid not in known:
821822
# ','.join(map(str,row.reinjection_of)
822-
self.poutput("packetid=%d (tcp.stream %d) is a reinjection of %d packet(s): "
823-
% ( row.packetid, row.tcpstream, len(row.reinjection_of))
824-
)
823+
output += ("packetid=%d (tcp.stream %d) is a reinjection of %d packet(s): " %
824+
(row.packetid, row.tcpstream, len(row.reinjection_of)))
825825

826826
# print("reinjOf=", row.reinjection_of)
827827
# assuming packetid is the index
@@ -831,9 +831,10 @@ def do_list_reinjections(self, line):
831831
entry = self.data.loc[ pktId ]
832832
# entry = df.loc[ df.packetid == pktId]
833833
# print("packetId %r" % entry)
834-
self.poutput("- packet %d (tcp.stream %d)" % (entry.packetid, entry.tcpstream))
834+
output += ("- packet %d (tcp.stream %d)" % (entry.packetid, entry.tcpstream))
835835
# known.update([row.packetid] + row.reinjection)
836836

837+
self.ppaged(output)
837838
# reinjections = df["reinjection_of"].dropna(axis=0, )
838839
# print("number of reinjections of ")
839840

0 commit comments

Comments
 (0)