From 04787e5516e72bbca2f071abb04af3fb67836450 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Tue, 4 Jan 2011 14:14:35 +0100 Subject: [PATCH] Re-allowing positional arguments for test-mpa.py, i.e., command line specification of input files. --- gui/test-mpa.py | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/gui/test-mpa.py b/gui/test-mpa.py index 387cf05..b940174 100755 --- a/gui/test-mpa.py +++ b/gui/test-mpa.py @@ -795,21 +795,32 @@ def bigTest(): global OPTS, ARGS - testpath = "Protocols/MultiProtocolAttacks/" - fl = os.listdir(testpath) + l = [] nl = [] - for fn in fl: - if fn.endswith(".spdl"): - nl.append(fn) + + """ + Check for any given filenames + """ + if len(ARGS) == 0: + # No filenames given + testpath = "Protocols/MultiProtocolAttacks/" + fl = os.listdir(testpath) + for fn in fl: + if fn.endswith(".spdl"): + nl.append(fn) + + # Prepend again the path + l = [] + for fn in nl: + l.append(testpath+fn) + else: + for fn in ARGS: + l.append(fn) + nl = l # Report list print "Performing multi-protocol analysis for the following protocols:", nl - # Prepend again the path - l = [] - for fn in nl: - l.append(testpath+fn) - fullScan(l)