Pumping pads as files into publishing frameworks!
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
usage = """Usage:
|
|
|
|
etherdump CMD
|
|
|
|
|
|
|
|
where CMD could be:
|
|
|
|
pull
|
|
|
|
index
|
|
|
|
dumpcsv
|
|
|
|
gettext
|
|
|
|
gethtml
|
|
|
|
creatediffhtml
|
|
|
|
list
|
|
|
|
listauthors
|
|
|
|
revisionscount
|
|
|
|
showmeta
|
|
|
|
html5tidy
|
|
|
|
|
|
|
|
For more information on each command try:
|
|
|
|
etherdump CMD --help
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
try:
|
|
|
|
cmd = sys.argv[1]
|
|
|
|
if cmd.startswith("-"):
|
|
|
|
cmd = "sync"
|
|
|
|
args = sys.argv
|
|
|
|
else:
|
|
|
|
args = sys.argv[2:]
|
|
|
|
except IndexError:
|
|
|
|
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
|
|
|
|
|