This commit is contained in:
Michael Murtaugh
2018-01-12 14:42:55 +01:00
parent 70ae27fe1f
commit 8df9c56ac1
21 changed files with 223 additions and 105 deletions
+6 -5
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import sys
usage = """Usage:
@@ -31,13 +32,13 @@ try:
else:
args = sys.argv[2:]
except IndexError:
print usage
print (usage)
sys.exit(0)
try:
# http://stackoverflow.com/questions/301134/dynamic-module-import-in-python
cmdmod = __import__("etherdump.commands.%s" % cmd, fromlist=["etherdump.commands"])
cmdmod.main(args)
except ImportError, e:
print "Error performing command '{0}'\n(python said: {1})\n".format(cmd, e)
print usage
except ImportError as e:
print ("Error performing command '{0}'\n(python said: {1})\n".format(cmd, e))
print (usage)