Issue #1844 - declare table headers before sorting the table rows in qpid-queue-count.

Former-commit-id: 71b443b525 [formerly da7371618c] [formerly 71b443b525 [formerly da7371618c] [formerly b956f09b37 [formerly 4f86b9cf6cf5e586199a08d2a470e232b1a8da1e]]]
Former-commit-id: b956f09b37
Former-commit-id: 77e2399fcf [formerly 063f0ed761]
Former-commit-id: 140a08b73a
This commit is contained in:
Bryan Kowal 2013-04-09 16:09:40 -05:00
parent 03ab0dcae3
commit edf0b442cb

View file

@ -159,7 +159,14 @@ try:
# evaluate the JSON
jsonStr = response.read()
jsonObjArray = json.loads(jsonStr)
# table header
heads = []
heads.append(Header("queue"))
heads.append(Header("msg", Header.KMG))
heads.append(Header("bytes", Header.KMG))
heads.append(Header("cons", Header.KMG))
# create rows of queues to display
rows = []
for staticDict in jsonObjArray:
@ -180,12 +187,6 @@ try:
# prepare to build & display the table
disp = Display(prefix=" ")
# table header
heads = []
heads.append(Header("queue"))
heads.append(Header("msg", Header.KMG))
heads.append(Header("bytes", Header.KMG))
heads.append(Header("cons", Header.KMG))
disp.formattedTable("Queues", heads, dispRows)
except KeyboardInterrupt:
print