Skip to content

Commit

Permalink
jira PDC-960, Order resources in client
Browse files Browse the repository at this point in the history
  • Loading branch information
bliuredhat committed Sep 6, 2015
1 parent 87d27e8 commit 4bc72c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion pdc_client/bin/pdc_client
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ def load_data(options):
print err
sys.exit(1)

def print_resources_in_order(api_url):
"""
print the url ordered by api
"""
api_url_dict = json.loads(api_url)
print '{'
for key_api in sorted(api_url_dict.keys()):
print " \"%s\": \"%s\"," % (key_api, api_url_dict[key_api])
print '}'

if __name__ == "__main__":
parser = optparse.OptionParser(version=__version__)
Expand Down Expand Up @@ -178,5 +187,6 @@ if __name__ == "__main__":
else:
with RequestMethod(client, session, options.resource,
options.traceback, options.debug) as request:
print json.dumps(request.dispatch(options.request, data),
api_url = json.dumps(request.dispatch(options.request, data),
indent=4)
print_resources_in_order(api_url)
2 changes: 1 addition & 1 deletion requirements/devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ setuptools
lxml
# model graph
# requires: graphviz-devel
pygraphviz
pygraphviz<1.3
# docs
Sphinx

0 comments on commit 4bc72c2

Please sign in to comment.