docstrings

This commit is contained in:
Wolfgang Hottgenroth 2013-11-13 21:42:30 +01:00
parent 500c773693
commit 3556b3686c

View File

@ -26,6 +26,7 @@ class MyCmd(cmd.Cmd):
self.prompt = "yadyn> "
def do_list(self, l):
"""list all or list <dynid>: List the details of all entries or of the entry specified by <dynid>"""
try:
parts = l.split(' ')
if len(parts) != 1:
@ -42,6 +43,7 @@ class MyCmd(cmd.Cmd):
self.stdout.write("Failure: %s\n" % str(e.msg))
def do_reset(self, l):
"""reset all or reset <dynid>: Reset the address details of all or of the entry specified by <dynid>."""
try:
parts = l.split(' ')
if len(parts) != 1:
@ -65,6 +67,7 @@ class MyCmd(cmd.Cmd):
self.stdout.write("Failure: %s\n" % str(e.msg))
def do_add(self, l):
"""add <dynid> <name> <zone> <shared secret>: dynid is the key of the entry, name is the left-most part of the hostname to be set, zone is the domain part of the hostname to be set, shared secret is the password."""
try:
parts = l.split(' ')
if len(parts) != 4:
@ -82,6 +85,7 @@ class MyCmd(cmd.Cmd):
self.stdout.write("Failure: %s\n" % str(e.msg))
def do_edit(self, l):
"""edit <dynid> <key> <value>: Change the name or the shared secret of the entry."""
try:
parts = l.split(' ')
if len(parts) != 3:
@ -100,6 +104,7 @@ class MyCmd(cmd.Cmd):
self.stdout.write("Failure: %s\n" % str(e.msg))
def do_delete(self, l):
"""delete <dynid>: delete the entry specified by dynid"""
try:
parts = l.split(' ')
if len(parts) != 1:
@ -128,6 +133,7 @@ class MyCmd(cmd.Cmd):
def do_quit(self, l):
"""quit: Quit the shell"""
self.stdout.write("Bye\n")
return True