Allow specification of working directory via constructor argument and related cleanup
Change-Id: Ifc73371c920d1d4e47b1fa04e57de5aebd2a6b40
diff --git a/minindn/minindn.py b/minindn/minindn.py
index c710d52..10dbcb4 100644
--- a/minindn/minindn.py
+++ b/minindn/minindn.py
@@ -55,7 +55,7 @@
resultDir = None
def __init__(self, parser=argparse.ArgumentParser(), topo=None, topoFile=None, noTopo=False,
- link=TCLink, **mininetParams):
+ link=TCLink, workDir=None, **mininetParams):
"""
Create MiniNDN object
:param parser: Parent parser of Mini-NDN parser
@@ -70,7 +70,11 @@
self.parser = Minindn.parseArgs(parser)
self.args = self.parser.parse_args()
- Minindn.workDir = os.path.abspath(self.args.workDir)
+ if not workDir:
+ Minindn.workDir = os.path.abspath(self.args.workDir)
+ else:
+ Minindn.workDir = os.path.abspath(workDir)
+
Minindn.resultDir = self.args.resultDir
if not topoFile: