示例#1
0
 def __init__(self):
     self.text = None
     self.authors = Authors()
     self.cursors = Cursors()
     self.color = None
     self.user_id = None
     self.changeset = None
示例#2
0
def run_api(args):
    log.debug("launched as API client")

    if not args.apikey:
        log.error("Missing API Key!")
        sys.exit(1)

    mypad = APIClient(args.apikey, "http://%s:%s/api" % (args.host,
                                                                   args.port))

    text = Text(Attributes(mypad, args.pad), Authors(), Cursors())
    idx = 0
    while True:
        try:
            cnt = int(mypad.getRevisionsCount(args.pad)["revisions"])
            if cnt+1 != idx:
                print chr(27) + "[2J" # clear screen
                print ""