From 0d170b25f1cecf699b061e45eecff7a32e5f2e20 Mon Sep 17 00:00:00 2001 From: Michael Murtaugh Date: Thu, 18 Jun 2015 14:56:48 +0200 Subject: [PATCH] better doc --- .gitignore | 1 + README.md | 25 +++++++++++++++++++++++++ etherdump | 4 ++-- padinfo.sample.json | 7 +++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 padinfo.sample.json diff --git a/.gitignore b/.gitignore index 7ee4f67..145af20 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ venv/ sites/ *.pyc *~ +padinfo.json diff --git a/README.md b/README.md index c9300fb..9a2754d 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,28 @@ Installation pip install html5lib jinja2 +Padinfo file +------------- +The easiest way to use etherdump is to create a padinfo JSON file that contains all the information necessary to connect to a particular etherpad server (including hostname, port, and API key). + + cp padinfo.sample.json padinfo.json + nano padinfo.json + +And then... + + etherdump --padinfo padinfo.json list + + +listpads +---------- + +To dump the names of the pads in JSON format: + + ./etherdump --padinfo padinfo.json listpads + + ./etherdump --padinfo padinfo.json listpads > pads.json + +To format for the screen add the --lines option: + + ./etherdump --padinfo padinfo.json listpads --lines + diff --git a/etherdump b/etherdump index 1250d76..d67af57 100755 --- a/etherdump +++ b/etherdump @@ -11,6 +11,7 @@ from datetime import datetime PADINFO_DEFAULTS = { "hostname": "", + "port": 9001, "apiversion": "1.2.9", "apiurl": "/api/" } @@ -326,8 +327,7 @@ if __name__ == "__main__": apikey=padinfo.get("apikey") ) - if verbose: - print ("Connecting to {0}".format(padserver.apiurl), file=sys.stderr) + print ("Connecting to {0}".format(padserver.apiurl), file=sys.stderr) ############################### # Command Dispatch diff --git a/padinfo.sample.json b/padinfo.sample.json new file mode 100644 index 0000000..a6f17b4 --- /dev/null +++ b/padinfo.sample.json @@ -0,0 +1,7 @@ +{ + "hostname": "localhost", + "port": 9001, + "apiurl": "/api/", + "apiversion": "1.2.9", + "apikey": "XXXXXXXXXXXXXXXXXXXXXXXXX" +}