better doc

This commit is contained in:
Michael Murtaugh 2015-06-18 14:56:48 +02:00
parent 117430b359
commit 0d170b25f1
4 changed files with 35 additions and 2 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ venv/
sites/ sites/
*.pyc *.pyc
*~ *~
padinfo.json

View File

@ -17,3 +17,28 @@ Installation
pip install html5lib jinja2 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

View File

@ -11,6 +11,7 @@ from datetime import datetime
PADINFO_DEFAULTS = { PADINFO_DEFAULTS = {
"hostname": "", "hostname": "",
"port": 9001,
"apiversion": "1.2.9", "apiversion": "1.2.9",
"apiurl": "/api/" "apiurl": "/api/"
} }
@ -326,8 +327,7 @@ if __name__ == "__main__":
apikey=padinfo.get("apikey") 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 # Command Dispatch

7
padinfo.sample.json Normal file
View File

@ -0,0 +1,7 @@
{
"hostname": "localhost",
"port": 9001,
"apiurl": "/api/",
"apiversion": "1.2.9",
"apikey": "XXXXXXXXXXXXXXXXXXXXXXXXX"
}