Arbitrary arguments
refs: #4360
Change-Id: I1c746c3349a72d1e262b75d4a864f096a2dfc018
diff --git a/ndn/experiment_manager.py b/ndn/experiment_manager.py
index f505646..5f2a174 100644
--- a/ndn/experiment_manager.py
+++ b/ndn/experiment_manager.py
@@ -35,6 +35,7 @@
def __init__(self):
self.experiments = {}
+ self.expArgs = {}
def loadModules(self):
currentDir = os.path.dirname(__file__)
@@ -51,6 +52,12 @@
def register(self, name, experimentClass):
if name not in self.experiments:
self.experiments[name] = experimentClass
+ try:
+ helpStr = experimentClass.arguments()
+ if type(helpStr) is str:
+ self.expArgs[name] = experimentClass.arguments()
+ except:
+ pass
else:
raise _ExperimentManager.Error("Experiment '%s' has already been registered" % name)
@@ -84,3 +91,8 @@
experimentNames.append(key)
return experimentNames
+
+def getExperimentArgs():
+ manager = __getInstance()
+
+ return manager.expArgs