~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to Code_python/DocServer/Solutions/zmq_doc_cmd_client01.py

  • Committer: Dave Kuhlman
  • Date: 2015-10-09 19:50:18 UTC
  • mfrom: (35.1.6 Materials)
  • Revision ID: dkuhlman@davekuhlman.org-20151009195018-8rfrdur2zxdjn5ds
Merge after training at Cisco 10/05/2015

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import sys
24
24
import getopt
25
25
from cmd import Cmd
26
 
import json
27
26
import zmq_doc_client01 as doc_client
28
27
 
29
28
 
56
55
        if len(args) != 1:
57
56
            return False
58
57
        id = int(args[0])
59
 
        message = doc_client.get_request([id], show=False)
60
 
        doc = json.loads(message)
 
58
        doc = doc_client.get_request([id], show=False)
61
59
        if doc is None:
62
60
            print 'document {} not found'.format(id)
63
61
        else: