mirror of https://git.48k.eu/ogcli/
list scopes: pretty print scope tree
Use json module to pretty print the scope tree. JSON keys are ordered and two-space indentation is used.master
parent
eb5091d374
commit
828d6c0ce7
|
@ -5,9 +5,12 @@
|
||||||
# Free Software Foundation; either version 3 of the License, or
|
# Free Software Foundation; either version 3 of the License, or
|
||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
class OgScope():
|
class OgScope():
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def list_scopes(rest):
|
def list_scopes(rest):
|
||||||
r = rest.get('/scopes')
|
r = rest.get('/scopes')
|
||||||
print(r.text)
|
payload = json.loads(r.text)
|
||||||
|
print(json.dumps(payload, sort_keys=True, indent=2))
|
||||||
|
|
Loading…
Reference in New Issue